Error in cancelling MIS order

rishiajmera
Hello team,
Today I faced an issue in cancelling an MIS SLM order. It gave the following error:
"Order cannot be cancelled as it is being processed. Try later."
Can you please tell me what is the reason behind this and what is the solution to handle such scenarios?

I really appreciate the support you guys are providing in such bad times! Stay safe.
Regards,
Rishi A.
  • sujith
    Hi @rishiajmera,
    One can cancel an order if the status is OPEN or TRIGGER PENDING. This is an error message when the user tries to cancel the order which is not currently in any of the above statuses.
  • rs7683
    I too got the same error and believe status was "Trigger Pending". I will test it again as I can test only until 3:30 PM. I will test and update tomorrow morning. For your reference below is my code:

    for i in range(len(kite.orders())):
    if (kite.orders()[i]["status"].find("PENDING") != -1):
    order_id = kite.orders()[-1]["order_id"]
    kite.cancel_order(kite.VARIETY_REGULAR, order_id, parent_order_id=None)
  • rs7683
    I found issue in my code. Nevermind please. I used "-1" instead of i in 1 place.
  • seshareddy
    @rs7683
    You mentioned above that you have some issue in the code. Would you please post the correct code so that it would be useful to us.
Sign In or Register to comment.