Let's say for example I place (while backtesting) an entry order on bar n which is then filled on bar n+1. After the order has been filled OnBarUpdate is called (with the appropriate OrderState). However, in this method all data (CurrentBar, Time[0], ...) still contains the values from the last bar (n) where the order was placed.
So when for example printing the date with each order placement and execution, it looks like the order has been placed and filled in the same bar. The order execution is however plotted on the correct bar in the chart.
So far this has not been a big issue for me, it only messes up the debug output a bit. This might however become a problem if any actions are to be performed after the order has been executed (e.g. place another order) which depend on data of the bar on which the first order was filled (e.g. opening price).
Comment