not receiving proper WebSocket data
-
@admin said in not receiving proper WebSocket data:
ws.send_request(token)
for SDK version 1.2.2 onwards this needs to be
ws.send_request(token,task)
where task is
task="mw", #'mw'|'sfi'|'dp'
-
@rajanprabu @ nirav
kindly generate feed token and use below code.from smartapi import WebSocket
FEED_TOKEN= "xxxxxxxx"
CLIENT_CODE="xxxxxxx"
token="nse_cm|2885&nse_cm|1594&nse_cm|11536"
#"nse_cm|2885&nse_cm|1594&nse_cm|11536"ss = WebSocket(FEED_TOKEN, CLIENT_CODE)
def on_tick(ws, tick):
print("Ticks: {}".format(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( )`
-
can you please share the code and your sdk version ( if you are using python )
-
Hi @nirav websocket is working fine from our end.
-
@admin ok sir tnx
I'm waiting for your answer. -
@admin, i found the issue, in token i have misspelled nse_cm, but i think there should an error msg stating invalid token.................
-
hi @nirav we have noticed your issue we will revert you back.
-
@admin
Hi sir
I tried to get live data by web socket..
I tried reliance and many other but every time I recieved only tcs tick data.
What is happening guide me. Tnx -
I am running from morning.. I don't see any issue either
-
hi @pavank web socket is working fine from our end.