Let’s say I have a listing order waiting to sell a certain instrument on the stock market.
If I run the OrderSendAsync () command to cancel this order, and shortly after that I run another OrderSendAsync () command to send a buy order to the market for the same instrument, is it guaranteed that my sell limit will be canceled before my market is bought the order is executed?
Is there a chance that the OrderSendAsync () commands are executed out of order, and my limit on putting up for sale is canceled by my purchase order in the market before it is canceled?
What if I use OrderSend () instead of OrderSendAsync ()?
ps: of course, I could just poll the pending sale status and wait for the cancellation to be confirmed before sending the sales order to the market, but due to performance requirements, I need the evacuation time between canceling the sales order and sending the purchase order as short as possible so that OrderSendAsync () would be preferable to OrderSend () if the desired sequence of events could be guaranteed.