PROBLEM:
I run the strategy from NT -> and get backtest, that has wrong results, because some orders are magically CANCELLED.
When I run the same strategy with visual studio debugger and stop at some breakpoints, it runs completely right - because some orders, that were previously cancelled are not cancelled now -> and they are correctly filled.
MAIN QUESTION:
Do you have any idea, what/where should I look for, to find out - what mechanisms in NT can cause this type "magic behind the scene" like cancellations of the orders ?
I know, that such "magic" cancellation can occur ,when :
- strategy has setup ExitOnClose = true
- RealtimeErrorHandling - can cause some "magical" cancellations
- ... maybe something else, I am not aware of...
PS
It is easily reproducible always, but I can't understand causes of the "magical" cancellations. Completely right backtest from debugger in Visual Studio, wrong backtest (because of some orders are magically cancelled) when I run backtest without VS debugger.
I don't call CancelOrder anywhere in my strategy - so I expect, the cancellation process is initiated by some NT API code - for example like in case of automatic error handling, when all position are closed and pending orders cancelled.

Comment