I'm having some issues with cancelling an order through the script of a strategy, which brings me to this question.
Let's say I have a 100 buy orders in a .Working or .Accepted state called "Buy". Then, based on certain conditions being met, my strategy is sending the CancelOrder(Buy) command and attempts to cancel all of the 100 working buy orders.
Now, in the OnOrderUpdate() override, when you check for "if (Buy.OrderState == OrderState.Cancelled)", will this condition trigger if only one or a few of the 100 "Buy" orders are cancelled? Or, will the condition trigger if all of the 100 "Buy" orders are cancelled completely?
I'm asking, because when "if (Buy.OrderState == OrderState.Cancelled)" is triggered, I am setting the "Buy" order back to a null state, and it might cause issues to attempt this while the "Buy" order hasn't been fully cancelled yet.
Thank you in advance for your time, I look forward to your response.
GLFX005
Comment