I am having a serious issue with live trading.
this is the sequence of events:
- One of my strategies issued a buy order for 1 ES contract.
- InteractiveBrokers: issued a warning message: Your order was repriced so as not to cross a related resting order.
- NinjaTrader: assumed the order is cancelled, not executed and terminated the strategy removed stop loss and target orders.
- InteractiveBrokers: executed the order at slightly higher price. (timestamped one second later)
- NinjaTrader reads the new execution as an open position not related to any strategy.
I couldn't understand the issue for a long time but now I guess I do. It seems that NinjaTrader (NT) is misreading this warning message as a rejection of the order when it is basically slippage and/or repricing. Then NT terminates the strategy although it executed the order a second later.
What is the solution for this? I know you will probably suggest I refrain from using market orders.. but that is weird. I also noticed this same issue happening with stop limit orders as well.
I'm not 100% sure my understanding is correct let me know thanks.
Comment