I am facing an issue when trying to use historical data for testing a strategy.
My strategy is making use of 2 different bar series, the 1minute for finding my entry conditions and the 1tick for the actual entries so that I can enter the trade like in a real time market. For this purpose I activated the TickReplay option.
It seems to be taking my entries like it should but the issue I have is with my stop loss. What happens is that if my stop loss price has occured during my entry bar, it will get triggered even if this price occured before my entry. See the snapshot below. I get this systematically. This seems to be related to the fact that my primary bar series is the 1minute and hence I get stopped when I shouldn't.
The way I typically put my entry/stop loss/take profit is like here below. The number 2 in my long entry is the ID of my 1tick bar series.
string order_id = "Long Entry"; EnterLong(2, 1, order_id); SetStopLoss(order_id, CalculationMode.Price, StopPrice, false); SetProfitTarget(order_id, CalculationMode.Price, ProfitPrice);
NinjaTrader 8
Many thanks for your help,

Comment