So probably asked multiple times, but I have been trying to get the proper answer for couple of days and unfortunately I didn't made it.
I've been reading some documentation and notes about the platform and the capabilities and made bunch of experiments before opening this thread. it seems like its a well known issue with the orders execution and filling logic differences but I want to tackle it the best as I can.
So my strategy logic supposed to execute the order action at the begging of a new bar (first or second tick, doesn't too crucial) by looking on the previous 5 bars that was completed (5 min chart), and if the condition is made, execute the order as soon as possible and fill it.
So for live trading the task is pretty much straight forward, at the onBarUpdate function of my new forming bar, I'm just looking at the close array (just for example) of the previous bars (Close[1], Close[...] ) and sending an enter order (without limit).
The problem with the same logic in historical filling is that I'm in a "bar late" because I'm executing the order at the right spot, but its only been filling in the start of the next bar and not the next tick (or price change) and this gives me big price differences that hurts the historical statistics very badly.
I overcome (kind of) this problem in a historical perspective by executing the order at the close of the previous bar, and than its being filled in the begging of the next one (as it should) but with the gap between close and open.
I've tried to implement with AddDataSeries(Data.BarsPeriodType.Tick, 1); and all the corresponding functionally described here : https://ninjatrader.com/support/help...ipt_strate.htm but still i can see that in history perspective the filling occurs only at the next bar. (and also have Calculate.OnEachTick defined.)
There is any way that I will be able to mitigate this issue at the same strategy file? meanwhile my plan was having one strategy only for backtesting and one for live trading.
Thanks in advance!

Comment