Doing a backtest. The Strategy enters at market and places a limit order to exit at the high of the bar (which was 259.08). This didn't fill for several bars, then there was a gap above this price. I would either expect the limit order to be cancelled or to be filled at the open price (264.27) of the gap up bar. But instead it was filled at the low of the day (260.61).
Can you explain what is happening please. Is there anything I can do in my code to mitigate this?
Thanks

Comment