I have created an auto strat that uses a stop and reverse technique, initially i wanted to use limits but because of internal order handling i've gone for a method whereby i execute a market order to go short once my long stop has been triggered. The issue with this is that in backtesting it doesn't show the market order in the correct place, it's always at the following bars open. Now initially i thought that was because of the tick data issue but today it occurred to me that I'm firing the logic inside the onexecution event for the stop loss trigger, so it doesn't seem to make sense that the market order should show at the next bars open as I thought the onexecution event fires on the execution of a limit which in this case is in the middle of the previous bar somewhere. Why then does it stick the market order at the beginning of the next bar as if it's only been executed during OnBarClose?
many thanks
Ross
Comment