Token List downLoad
-
@admin
python 3.8.3 -
Hi @Heena-Shah which version of sdk you are using.
-
@admin
token="nse_cm|2885"
task="sfi" # mw|sfi|dpobj=SmartConnect(api_key=api_key)
login = obj.generateSession(client_code,your_password)
#refreshToken= login['data']['refreshToken']
feedToken=obj.getfeedToken()#userProfile= obj.getProfile(refreshToken)
ss = WebSocket(feedToken,client_code)def on_tick(ws, tick):
print("Ticks: {}".format(tick))def on_connect(ws, response):
ws.websocket_connection()
ws.send_request(token,task)def on_close(ws, code, reason):
ws.stop()Assign the callbacks.
ss.on_ticks = on_tick
ss.on_connect = on_connect
ss.on_close = on_closep1 = multiprocessing.Process(target = ss.connect())
sys.exit()
p1.start()Getting only...
<function on_connect at 0x00000227435DFEE0>
Ticks: [{'ak': 'nk', 'msg': 'sfi', 'task': 'sfi'}] -
Hi @Heena-Shah we will update the code in this code.we will update you once we do that.
-
@admin when will b new updated websocket code available
-
hi @Heena-Shah we will update the web socket code soon.
-
HI @Heena-Shah Please do not share your private credential publicly here.
-
<function on_connect at 0x000001716110FEE0>
getting above error
-
from smartapi import SmartConnect
from smartapi import WebSocketobj=SmartConnect(api_key="")
data = obj.generateSession("","")
feedToken=obj.getfeedToken()WebSocket
token="nse_cm|2885"
ss = WebSocket(feedToken,"")def on_tick(ws, tick):
print(tick)def on_connect(ws, response):
ws.send_request(token)def on_close(ws, code, reason):
ws.stop()Assign the callbacks.
ss.on_ticks = on_tick
ss.on_connect = on_connect
ss.on_close = on_closess.connect()
-
Hi @Heena-Shah you can convert json to csv save it and use it.