Kindly look into below issue. I was suppose to close my trade @ specified time, but due to this technical issue (NEST gateway timed out), incur in losses. please also provide the solution for this asap, so that this kind of issue don't happen in future.
The same code was working fine for several days.
Error msg: In Debug mode. Starting new HTTPS connection (1): api.kite.trade:443 https://api.kite.trade:443 "PUT /orders/regular/190712000221563 HTTP/1.1" 503 98 Order Modification failed: NEST gateway timed out.
Note: "Order Modification failed" is from custom log msg ..
I faced this issue @3:15pm while modifying slm order and this is an intermittent issue. I faced this issue first time in 3 weeks. I recently started using kite python api.
When I faced this issue, I again tried to modify the order via api, got the same issue ; finally closed my trade via terminal, not via api
This is an error message you receive when OMS is not responding due to high traffic during the closing, it is possible that the OMS has modified the order or may not. You need to check orderbook and retry if it is not modified. This can happen across the platforms since OMS is the same for all our platforms. Either you can try the above alternative or close your position a little earlier.
Always have a retry system which tries atleast one more time if there is an exception for any API as a general rule. You should always expect network issues when dealing with things like this and have a backup plan. I'd also advise you get the order book and see if your order has been placed despite the exception before retrying. In the worse case, always set up an alert system which will do something like call you using an API when you get an unexpected error
When I faced this issue, I again tried to modify the order via api, got the same issue ; finally closed my trade via terminal, not via api
This can happen across the platforms since OMS is the same for all our platforms. Either you can try the above alternative or close your position a little earlier.
Please guide me how can I check orderbook if order is modified or not for a particular order id.