If you are placing the exit orders in OnExecution then you are not waiting for the next bar to place the exits, you are placing the exits immediately after the entry order has filled (intra-bar). If an order is placed intra-bar it can fill intra-bar.
OnExecution triggers when an order fills, not when a bar closes.
Instead of placing the exit immediately after the entry has filled, place the order after the bar has closed in OnBarUpdate as previously suggested.
Comment