The symptoms are as follows.
1. The strategy uses daily bars, and unmanaged orders with both a stop and limit exit
2. Those exit orders are updated every bar - A sort of custom "advancing target/trailing stop"
3. Backtest results vary depending upon the order in which the instruments are assigned to the various BarsInProgress.
As far as can tell from experimenting with a custom fill type inside the VS debugger, the strategy analyzer checks each open order for each new bar for EVERY instrument, but OnBarUpdate() is only called once per new bar per instrument, as you would expect. This means that the check for a fill is called BEFORE OnBarUpdate() modifies the exits for all the instruments where BarsInProgress > 0.
If my explanation makes sense, has anyone come across this issue before? If so, is there a simple solution?

Comment