Today I faced an issue in canceling a regular order which is in the Open position. It gave the following error:
"Order cannot be canceled as it is being processed. Try later."
This is what I tried: curl --request DELETE "https://api.kite.trade/orders/regular/[My Order Number]" -H "X-Kite-Version: 3" -H "Authorization: token API_Key:Access Token"
Result: {"status":"error","message":"Order cannot be cancelled as it is being processed. Try later.","data":null,"error_type":"InputException"}
Can you please tell me what is the reason behind this and how to fix it?
This is because you are trying to send a cancel request when the order processing is still going on. You need to make sure order is in the open state or trigger pending state.
We executed this order and after an hour or so tried to exit out of it. Do we need to wait more to check the "open" state of the order? How much time does it take to have the order in "Open" state after initial execution? Awaiting your response.
You need to make sure order is in the open state or trigger pending state.
We will check and get back to you.
For exiting a position, you can check out this thread.