Once the entries get filled, I am setting the StopOrder: https://ibb.co/XynZgCN
On every bar, I am changing the StopOrder: https://ibb.co/vhVH2dS
On every bar, I am checking if StopOrder == null. if yes, then close the order: https://ibb.co/D9pQNkh
Now I am getting this error sometimes: https://ibb.co/MRn8m5V
I think the problem is something like this: When the price is touching the stop order, its cancelling, but it is taking some time to do that. In the mean time strategy is trying to change the stop order. That's where the error is taking place. Is there a way to use Advanced Order Handling to check if a trade is pending cancel order? so that instead of checking for StopOrder == null, i can check if StopOrder is pending for cancel or not? Or some other solution. Thank you
Comment