regular order can't get exit

Vinoth
kiteconnect.exceptions.InputException: Order cannot be cancelled as it is being processed. Try later.
the above error showing when i try to square off a position.
this is my code:
history = kite.order_history(order_id)[-1]['status']
if history == 'COMPLETE':
exit= kite.exit_order(variety=kite.VARIETY_REGULAR, order_id=order_id)
print(exit)
Sign In or Register to comment.