Code 1006 in KiteTicker

harshnisar
harshnisar edited June 2020 in Python client
I have same code as documentation for KiteTicker, with the only modification that order updates are printed and then are added to a predefined list.
def on_order_update(self, ws, data):
print(data)
try:
OrderList += [data]
except:
pass
I am not running the KiteTicker in the main thread (threaded=True)
I do not subscribe to any instruments. I am just using the KiteTicker to track order updates.
Some days it works flawlessly all day. Other days, i get the following randomly after a few hours of initiation:
Connection error: 1006 - connection was closed uncleanly (None)
Connection closed: 1006 - connection was closed uncleanly (None)
I went thru discussions here, but all they seemed to prescribe was to have minimal work be done in the callbacks, which I think I'm already doing, i.e. print and append.

Why am I getting 1006?
  • sujith
    You can check out pykiteconnect section in the FAQs.
  • harshnisar
    Thanks, will check and let you know. I assumed the computations I am doing in on_order_update are not heavy enough.
  • harshnisar
    I've found that whenever what I described happens, its right after I do the following two in quick succession: send an order and subsequently check order history.

    I have a feeling that this is related to 1006 because the on_order_update is practically doing nothing (see prior post).
Sign In or Register to comment.