zerodha / pykiteconnect

The official Python client library for the Kite Connect trading APIs
MIT License
981 stars 469 forks source link

Multiple Instruments not receiving ticks #86

Closed karthickbala123 closed 4 years ago

karthickbala123 commented 4 years ago

Connection closed: 1006 - connection was closed uncleanly (I dropped the WebSocket TCP connection: close reason without close code)

when i subscribe list of instruments i received above error. then how receive multiple instruments ticks

`# Assign the callbacks watch_list = [int(i) for i in tsht.range("A2").expand('down').value]

[779521, 738561, 1102337]

def on_connect(ws, response): ws.subscribe([watch_list]) ws.set_mode(ws.MODE_QUOTE, [watch_list])

kws.on_ticks = on_ticks kws.on_connect = on_connect kws.connect()`

vijaykz commented 4 years ago

Parameter to ws.subscribe should be a list. From the looks, it seems you're passing a list of list.
Try:

ws.subscribe(watch_list)
ws.set_mode(ws.MODE_QUOTE, watch_list)
karthickbala123 commented 4 years ago

@vijaykz Thanks now its working😀🤝👍