It looks like you're new here. If you want to get involved, click one of these buttons!
.Net API client
.Net / VBA / Excel (3rd party)
Algorithms and Strategies
Mobile and Desktop apps
Market data (WebSockets)
In this Discussion
'kiteconnect.exceptions.NetworkException' in modify order when called at 9.15 AM
The same exact code worked for the past month. I have been getting this error for the past week every single time I place a modify order call.
kite.modify_order(variety=order['variety'], order_id=order['order_id'], parent_order_id=order['parent_order_id'], order_type=kite.ORDER_TYPE_MARKET)
Error When Placing Orders
Is it happening specifically only at 9:15 AM or post 9:15 AM also?
Can you post the log traceback?
edited February 14
Before too. I usually test if the order is placed when your adapter is down. This time I tested it at 9.11AM when you can't place any orders. Usually, I get a rejected order in the site, but, this time it didn't get placed to the site at all, with the above-mentioned error. I'm not sure if it happens after 9.15
line 963, in modify_all_orders
kite.modify_order(variety=order['variety'], order_id=order['order_id'], parent_order_id=order['parent_order_id'], order_type='MARKET')
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\kiteconnect-3.7.6-py3.6.egg\kiteconnect\connect.py", line 346, in modify_order
return self._put("order.modify", params)["order_id"]
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\kiteconnect-3.7.6-py3.6.egg\kiteconnect\connect.py", line 705, in _put
return self._request(route, "PUT", params)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\kiteconnect-3.7.6-py3.6.egg\kiteconnect\connect.py", line 766, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.NetworkException: NEST gateway timed out.
This is the traceback. I got the error just now
As the error describes, there was gateway time out from OMS.
If NetworkException happens while placing an order you need to handle exception at your end and then check the orderbook(if order already placed),if not then retry placing order.
All my orders are retried twice. It failed every single time
Like I said, this was working perfectly the past week. no changes was made
This is basically because we process more orders than what the exchange lease lines could handle at the market opening. We have applied for more lease lines but it is a slow and tedious process. We are trying our best to get it resolved.
Good to know, hope it's resolved quickly
This issue is still present. It works about 25% of times, making it very unreliable. Even after 3 retries, it's not executed. Please check into the issue, all other types of placing orders except for modify order doesn't seem to have this issue
This only happens in the morning, particularly at 9:15AM, there has been no issues in the evening
I'm currently forced to use alternates to the modify_order function because of this. It's really unfortunate that I have to do this. Kindly make the necessary measures and let us know if and when they are done. Looking forward to the improvements
This issue is still still not solved. modify_order is not working before 9.20AM but works perfectly in the evening using the exact code
Everything else is working almost perfectly with your API except for this. I've pasted the function that I use to place the modify_order