It looks like you're new here. If you want to get involved, click one of these buttons!
from kiteconnect import WebSocket
import pandas as pd
def on_tick(tick, ws):
print(tick)
def on_connect(ws):
stocks=['ACC']
ws.subscribe(stocks)
api_key="xx" # my api kep
public_token="xx"
user_id="xxx" #my user id
#on_connect()
kws = WebSocket(api_key, public_token, user_id, reconnect=True, reconnect_interval=5, reconnect_tries=50)
#kws.on_tick = on_tick
kws.on_connect = on_connect
kws.connect()
Are you sure you are not disconnecting from anywhere else?
You can also set on_close callback and print a message inside that.
I am not disconnecting from anywhere else. what could be the issue?