You will get this error when you try to modify an order that is not in OPEN or TRIGGER_PENDING status. Basically this error simply means that order status has changed very recently & your operation (modify/cancel) might not be valid for the order.
Some of the common causes are:
- Trying to modify an order that is not open
- Trying to cancel an order that is not open or already cancelled
- Trying to modify or cancel an order that is yet to be confirmed by the exchange
Solution
It is obvious that only an order that is open can be modified. So technically it is not possible to modify it. A user should refresh that order to check it’s latest status & then take appropriate action.