It looks like you're new here. If you want to get involved, click one of these buttons!
2019-05-10 09:34:13+0530 [-] Connected to WebSocket
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (I dropped the WebSocket TCP connection: close reason without close code)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (I dropped the WebSocket TCP connection: close reason without close code)
2019-05-10 09:34:13+0530 [-] subscribing to tokens: [121345, 3329, 5633, 3350017, 5436929]
2019-05-10 09:34:13+0530 [-] dropping connection to peer tcp4:13.127.19.183:443 with abort=True: I dropped the WebSocket TCP connection: close reason without close code
2019-05-10 09:34:13+0530 [-] <twisted.internet.tcp.Connector object at 0x0000017A0FE0EEB8> will retry in 2 seconds
2019-05-10 09:34:13+0530 [-] Stopping factory <kiteconnect.ticker.KiteTickerClientFactory object at 0x0000017A0F6EEC18>
Part of my code:
def on_ticks(self, ws, ticks):
for tick in ticks:
print('processing tick: ', tick)
def on_connect(self, ws, response):
print('Connected to WebSocket')
tokens = list()
for symbol in self.df_symbol_data.index:
tokens.append(kite_symbol_to_token(symbol))
print('subscribing to tokens: ', tokens)
ws.subscribe(tokens)
ws.set_mode(ws.MODE_QUOTE, tokens)
print('tokens: ', tokens)
def main(self):
self.initialize()
self.kite_ticker.on_ticks = self.on_ticks
self.kite_ticker.on_connect = self.on_connect
self.kite_ticker.connect(disable_ssl_verification=True)
I can confirm that access token is received and set correctly. Just before the execution of the websocket , I am also fetching historical data which is being done as it should.
If you have any blocking script inside on_ticks, please move it to separate thread.
The on_ticks function I have posted here is the exact bare one I am using as I am just testing the functionality now. Its failing.
We tested same code as given above by you and ticks are coming fine at our end.
The Kite API expects native python int datatype.
Great. This reply is one of the reason that Kite's API leaves everyone else far behind.