It looks like you're new here. If you want to get involved, click one of these buttons!
api_key = "***********" # api_key
kws = ""
access_token = input("Access Token: ")
print(access_token)
kws = KiteTicker("api_key", "access_token")
kws.on_ticks = on_ticks
kws.on_close = on_close
kws.on_error = on_error
kws.on_connect = on_connect
kws.on_reconnect = on_reconnect
kws.on_noreconnect = on_noreconnect
kws.connect(threaded=True)
-------------------------------------------------------------------------
I tried running the .Net code with same access token again, it is working fine. But this python ticker module is thowing error.
kws = KiteTicker("api_key", "access_token")
Now it is throwing different error
2019-10-11 12:26:39,917 ERROR MainProcess ticker.py:660 Connection error: 1006 - connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
----------------------------------------------------
def on_connect(ws, response):
global tokens
print(tokens)
ws.subscribe(tokens)
ws.set_mode(ws.MODE_LTP, tokens)
-------------------------------------------------------------
Console print value: [256265, 256265]
Thank you.
Can someone provide solution for this? Any reference to code sample will help me. Thank you.
The above error occurs when you block on_tick thread with some operation internally.You may check the threading example here.