Unable to Connect

BG8408
Hi Please help!

I m getting below error.

Connection error: 1006 - connection was closed uncleanly (I dropped the WebSocket TCP connection: on_connect() takes 1 positional argument but 2 were given)
I checked my api_key, secret_key, request_token, access_token. Everything is fine.

Why it is not connecting? Below is my code:

kws = KiteTicker(api_key, kite.access_token)

tokens = [119553]

def on_ticks(ws,tick):
print(ticks)

def on_connect(ws):
ws.subscribe(tokens)
ws.set_mode(ws.MODE_FULL, tokens)

kws.on_ticks = on_ticks
kws.on_connect = on_connect

kws.connect()
Tagged:
This discussion has been closed.