I have problems with how orders are executed in NinjaTrader on backtesting. Here is the situation.
My strategy works with 60 minutes bars and it uses unmanaged orders. Since it is pretty dificult to explain the situation I attach an image that clearifies the situation.
The orders that are executed in the 13:00 bar are:
- A Buy/Stop order as a stopLoss for the short position entered in the previous bar and using 130.99 as the stop price.
- A Buy/Stop order to enter Long with stop in 131.04.
Well, that bar opens below both stopPrices and closes over them, so the reasonable order for executing those orders would be: first de Stoploss at 130.99 and after this one the enterLong at 131.04; but, as you can see in the image, the order applied is the contrary.
I think that the problem is that when backtesting, NT executes the orders following the order in what they are written in the code instead of applying a more logical approach... ¿Is this the problem? ¿How can I solve it in an easy way?
Thanks in advance.
P.S: It was hard to me to explain the problem so wether something is not clear, please ask me and I'll try to explain myself in a better way.

Comment