not receiving proper WebSocket data
-
@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( )`
-
@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'
-
@admin ok sir tnx issue is sloved. bt
open interest live datafeed avaliable for nifty index ?
if not so how i get it ?
tnx -
@admin
I try to get by web socket
(Ex= nifty 15000 ce open interest) -
No, OI is not streamed via WebSocket. It's yet to be added in WebSocket response.
-
@admin
Can you give any rough estimate when will you start streaming OI ? -
@admin
hii sir very good noon
why i recive a heart beat error msg on live web socket data streaming. any solution for this plz tell me . its very important for me.
tnx -
HI @nirav we have noticed your query we will update you on this.
-
This normally happens with network drop. If you are using new python SDK, you may potentially overcome this.
-
@rajanprabu
sir i have install python sdk just tomorrow, so its a latest. till i getting heart beat. any solution for this by api team or not. my deadline is very close. suggest me asaptnx
-
Its hard to suggest with fewer details available. Are you running it on the cloud or at home with Wifi ? WiFi drop can also cause this.
-
Hi @nirav said in not receiving proper WebSocket data:
sir i have install python sdk just tomorrow, so its a latest. till i getting heart beat. any solution for this by api team or not. my deadline is very close. suggest me asap
Hi nirav as discussed in the meeting we will update you on this.
-
@pavank did you get any solution of the problem? I am facing exactly same issue.
-
@admin facing same issue, only receving tm data
[{"tvalue":"16/02/2023 11:35:12","name":"tm"}]
[{"tvalue":"16/02/2023 11:35:13","name":"tm"}]
[{"tvalue":"16/02/2023 11:35:14","name":"tm"}]
[{"tvalue":"16/02/2023 11:35:15","name":"tm"}]Here is code :
var ws =new websocket('', '',"nse_cm|2885", "mw");
ws.connection().then(() => {
ws.runScript("nse_cm|2885&nse_cm|1594&nse_cm|11536", "mw|sf|dp");
setTimeout(function () {
ws.close()
}, 30000)
});
ws.on('tick', receiveTick);function receiveTick(data) { console.log(data); }