I am backtesting my strategy and it is generally working as planned with the exception of the following scenario:
I have an initial stop loss (using ExitLongStop with signal name "Initial SL") and then as the position moves in my favour, I change to a trailing stop loss (using ExitLongStop with signal name "ATR Stop"). In most circumstances, this works fine and just cancels the pending "Initial SL" exit order if the trailing stop order is filled. However in one scenario during the backtest, the market goes through both stop orders in one bar but the system picks the lower Initial SL order to process, not the higher trailing stop loss order.
I assume in live trading this should work correctly with the higher stop being triggered first, but I wanted to get an understanding why this would happen during backtesting?
I guess I could cancel the initial stop loss order when the trailing stop loss order is submitted, but I didn't mind the idea of having both there as a failsafe if something went wrong with one of the orders.
Any thoughts would be much appreciated.
Regards,
Kylie.
Comment