I've been getting some progress with my automatic trading strategy, but I've noticed that sometimes there will be old working sell stop orders that should have been cancelled by the strategy, and I realize that sometimes a CancelOrder (using unmanaged orders) doesn't always succeed the first time issued.
I've tried using a do while loop like this
do
{
CancelOrder(ExitOrder)
} while (ExitOrder.OrderState != OrderState.Cancelled);
but that just makes my program freeze, even if I use System.Threading.Thread.Sleep(1000); to make it wait between cancel commands.
So I found there is this:
this.WaitOnCancelConfirmationSeconds but I can't find anything about it in the help file. Can someone let me know if this is something that can be used with my UnManaged order handling to make sure my cancelled orders are really cancelled?
Thanks!
Comment