I think the reason for that is orderId is being reset at the bar close in the OnBarUpdate() method and the strategy is not able to enter simultaneously. There is discrepancy between the backtesting and live results (see the attachment). I would like to enter at the close, even when a trade is stopped out at the close. how can i do this? any suggestions?
thanks for your time

Comment