'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)
  • rakeshr
    Is it happening specifically only at 9:15 AM or post 9:15 AM also?
    Can you post the log traceback?
  • rishiswethan
    rishiswethan 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
  • rishiswethan
    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.

    @rakeshr This is the traceback. I got the error just now
  • rakeshr
    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.
  • rishiswethan
    All my orders are retried twice. It failed every single time
  • rishiswethan
    Like I said, this was working perfectly the past week. no changes was made
  • sujith
    Hi @rishiswethan,
    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.
  • rishiswethan
    Good to know, hope it's resolved quickly
  • rishiswethan
    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
  • rishiswethan
    This only happens in the morning, particularly at 9:15AM, there has been no issues in the evening
  • rishiswethan
    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
  • rishiswethan
    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
  • rishiswethan
    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

Sign In or Register to comment.