Facing problem when streaming the live data
-
@admin Sir can you please tell me what is the issue is happening???
And why it's happening....... -
Hi @nayan_nandi we regret for the delay we will keep you updated on the issue.
-
@rajanprabu said in Facing problem when streaming the live data:
@nayan_nandi
if you using new 1.2.2 python SDK you need to send task parameter as well.
def on_connect(ws, response):
ws.send_request(token,'mw')did you try this @nayan_nandi ?
-
@admin Sir any update ????
Same problem today also
-
Hi @nayan_nandi we are testing it from our side.we will update you on this.
-
@admin Sir same problem in market hours
I'm using Trading API. And when I print feedToken it's print "None" my code is____from smartapi import SmartConnect from smartapi import WebSocket obj = SmartConnect(api_key=apikey) data = obj.generateSession(client_token, password) feedToken = obj.getfeedToken() print(feedToken) FEED_TOKEN = feedToken CLIENT_CODE = client_token token = "nse_cm|2885" # Token number of RELIANCE-EQ task = "mw" # 'mw'|'sfi'|'dp' ss = WebSocket(FEED_TOKEN, CLIENT_CODE) def on_tick(ws, tick): print("Ticks: {}".format(tick)) def on_connect(ws, response): ws.send_request(token, task) def on_close(ws, code, reason): ws.stop() ss.on_ticks = on_tick ss.on_connect = on_connect ss.on_close = on_close ss.connect()
-
Hi @nayan_nandi Web socket only works in live markets so try it in market hours.
-
@admin Sir when i run the code it's showing like this___
and sir can you please tell me how to get the scripts token list including equity, futures, options....... -
Hi @nayan_nandi please try below piece of code.
from smartapi import WebSocket
FEED_TOKEN= ""
CLIENT_CODE=""
token= "nse_cm|2885&nse_cm|1594&nse_cm|11536"
task="mw" #'mw'|'sfi'|'dp'
ss = WebSocket(FEED_TOKEN, CLIENT_CODE)def on_tick(ws, tick):
print("Ticks: {}".format(tick))def on_connect(ws, response):
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_closess.connect( )
-
if you using new 1.2.2 python SDK you need to send task parameter as well.
def on_connect(ws, response): ws.send_request(token,'mw')