Livefeed using sockets
-
@vishant No, I'm not getting the desired output. I had tried the given Python code during the market hours also, but it was giving me the same error. May be it is the issue with Python SDK or I'm missing some parameters.
-
Hi @rjbanna,
I am using Node SDK - https://github.com/angelbroking-github/smartapi-javascript
Also, I am using the same code which is mentioned in the link above.
let web_socket = new WebSocket({
client_code: "CLIENT_CODE",
feed_token: "FEED_TOKEN",
script: "nse_cm|2885&nse_cm|1594" //exchange|token for multi stocks use & seperator
});web_socket.connect();
web_socket.on('tick', receiveTick)function receiveTick(data) {
console.log("Receive stock ticks::", data)
}You can also try copy pasting the code from Python SDK, it should work.
-
@vishant I tried the same code before also but it's not working.
-
It looks like issue is with the python, i think they have not started python websocket streaming service, there is no word from @bhaveshjain regarding this matter, and there is no proper documentation for python ,
so I'm hoping @bhaveshjain could clarify this matter, and how long it will take when service will resume for python. -
@bhaveshjain ok ..
-
@bhaveshjain Sure, I'll check it and let you know soon.
-
@bhaveshjain I checked the websocket API and it is working as expected. There is one typo in the README.md file on Github. In the code feedToken=obj.getFeedToken(), the function name is misspelt. In the smartConnect.py file, the function name is getfeedToken(). with the "feed" in lowercase where as in the example it is "Feed" with first letter capital. So kindly resolve that issue or else people will receive the following error "'SmartConnect object has no attribute 'getFeedToken'". Thanks
-
@bhaveshjain Can you please elaborate following terms that I receive as a response from socket? They are to, lo, sp, c(if this is close, then which close is it referring to?), tk, bs, bp, cng, bq, ap, nc, name, tbq.
-
Hi @rjbanna,
Request you to raise this same query as a general discussion. So that other people will also be informed about this.
-
@vishant I have created the new thread for the same.
-
Hi @admin @bhaveshjain I am using latest SMARTAPI-PYTHON and getting the below output only for token="nse_cm|3045". I have tried few more ticks as well but still getting the same output.
Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]
Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]
Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]
Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]
Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]
Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]Please let me know how can I get data.
-
Hi @dushyant , I suppose you're passing wrong feedToken. Please review.
-
I am facing the exact issue faced by @dushyant . Even I used the same token: 3045 which is the token for SBIN-EQ.
{"token":"3045","symbol":"SBIN-EQ","name":"SBIN","expiry":"","strike":"-1.000000","lotsize":"1","instrumenttype":"","exch_seg":"NSE","tick_size":"5.000000"}
The data is from the instruments API. which means the instrument data is wrong?
BR
Dheepi -
Hi @dheepi , please share your contact details on api@angelbroking.com
-
@admin Thanks for your help. The issue is solved.
-
@admin
Getting same error
Co No:- 8000662244
mail:- mangroliyadj6293@gmail.com
Client id : D108750 -
@Ashok what was wrong ??
-
@rajanprabu are you asking about the error faced in Dec ? That is due to wrong formatting of the input text to the WS Script
-
What does the response key:values mean?
Would be helpful if someone can explain what does the below values like tm,tvalue,ak,msg,etc mean, where can i find the documentation for these?Ticks: [{'name': 'tm', 'tvalue': '25/02/2021 23:31:21'}
Ticks: [{'ak': 'ok', 'msg': 'connected', 'task': 'cn'}] -