I Have developed an algorithm which generates signals per minute. Suppose for a buy signal I place a market cover order and in the next minute I wish to exit the second leg of the cover order. I am using the following syntax to exit the second leg
kite.exit_order(order id= oid, parent order id = poid, variety='co')
The above syntax throws the following error
Cannot cancel order as it is being processed Try later.
During the kite.exit_order() call the status of the order is "TRIGGER PENDING"
Once I place my order and try to cancel it through the same program after some time delay it throws the said error
If you handle above exception and retry with sufficient delay, it should work as desired. Can you paste here the required CO order placement and cancellation code? We will take look at it.
Between kite.place_order() and time.delay(45) there is logic that decides the value of the variable 'signal' . According to its value the decision to exit the order is taken.
I have Confirmed that the order id which is passed is in an appropriate manner.
Once I place my order and try to cancel it through the same program after some time delay it throws the said error
I am able to exit the order using same syntax but through a different script and not for the one i wanted to.
Can you paste here the required CO order placement and cancellation code? We will take look at it.