My system operates on 1 second interval. I use SetBacktestMode(backtestRegularRaw). I allow same bar entry / exit (as visible on 2nd screenshot).
On 1st screenshot I marked position reversals which are correct (happen within the same second) with green checkmarks. The ones I have problem with, have dates surrounded with red circles. Remaining rows have position closed just before end of session, what is correct and can be ignored.
I wonder why the ones with red circles have some gaps before reverse position is opened. On backtest (2nd screenshot) I presented signals for one such situation from backtest (2nd red circles pair). Current signal is Short, then on 09:26:08 Buy appears, so I would expect Long position to be opened since this bar, but it is entered on next buy signal on 09:27:02 instead. Buy condition is in this case High >= 2139. In other 2 cases also Long position has been entered on the very next Buy signal.
The problem exists for Buy -> Short reversal as well and the one I checked had Long closed on 1st Short signal, but Short opened 3 Short signals later.
All candle prices and signal prices are integers.