Live market feed
-
Hello does anyone able to access live market feeds thru smart API?
There is no documentation for live feed, as we required endpoints for request types. -
@bhaveshjain ,
this link is not giving any information . can you check from your side. -
HI @ameyakhot post your piece of code here.
-
{'task': 'cn', 'channel': 'NONLM', 'token': '', 'user': '', 'acctid': ''}
2021-08-02 09:23:02.974655 : Start task in the background
{'task': 'hb', 'channel': '', 'token': '', 'user': '', 'acctid': ''}
on open
Ticks: [{'ak': 'ok', 'msg': 'connected', 'task': 'cn'}]
Ticks: [{'ak': 'ok', 'msg': 'heartbeat', 'task': 'hb'}]
Ticks: [{'name': 'tm', 'tvalue': '02/08/2021 09:23:06'}]
Ticks: [{'name': 'tm', 'tvalue': '02/08/2021 09:23:07'}]
Ticks: [{'name': 'tm', 'tvalue': '02/08/2021 09:23:08'}]
Ticks: [{'name': 'tm', 'tvalue': '02/08/2021 09:23:09'}]This is the return value I'm getting from the websockets live market feed.
@admin Can you share why this might be happening? -
@tcmstunner said in Live market feed:
@admin
Hi Admin, at first opening, tick data that I'm getting for token 49853 is as below
{ "to": "42797910.00", "lo": "14200.10", "e": "nse_fo", "sp": "14266.90", "c": "14189.45", "ltp": "14266.90", "ltq": "75", "tk": "49853", "bs": "300", "ltt": "07/01/2021 09:15:00", "tsq": "32625", "v": "3000", "bp": "14266.00", "cng": "77.45", "bq": "150", "ap": "14265.97", "nc": "00.55", "name": "sf", "tbq": "80175" }But when I'm checking here
https://trade.angelbroking.com/portfolio/chart?flag=der&exch=FONSE&instru=FUTIDX&symbol=NIFTY&exp=28-01-2021&option=XX&strikePrice=-1&ntoken=49853&label=NIFTY 28 Jan 2021&lotsize=75&period=5m&views=&display=Candle&defaultPeriod=1DOpening price is showing 14,200.10
But in above response ltp is 14266.90Can you please clarify what should be the market open price?
@tcmstunner said in Live market feed:
@admin
Please also confirm low price & high price on first opening of marketThe high and open field are missing at team is working on it as per admin
https://smartapi.angelbroking.com/topic/142/websocket-data-missing-high-field -
@admin
Please also confirm low price & high price on first opening of market -
@admin
Hi Admin, at first opening, tick data that I'm getting for token 49853 is as below
{ "to": "42797910.00", "lo": "14200.10", "e": "nse_fo", "sp": "14266.90", "c": "14189.45", "ltp": "14266.90", "ltq": "75", "tk": "49853", "bs": "300", "ltt": "07/01/2021 09:15:00", "tsq": "32625", "v": "3000", "bp": "14266.00", "cng": "77.45", "bq": "150", "ap": "14265.97", "nc": "00.55", "name": "sf", "tbq": "80175" }But when I'm checking here
https://trade.angelbroking.com/portfolio/chart?flag=der&exch=FONSE&instru=FUTIDX&symbol=NIFTY&exp=28-01-2021&option=XX&strikePrice=-1&ntoken=49853&label=NIFTY 28 Jan 2021&lotsize=75&period=5m&views=&display=Candle&defaultPeriod=1DOpening price is showing 14,200.10
But in above response ltp is 14266.90Can you please clarify what should be the market open price?
-
Hi @vishant,
I am facing auto close issue, issue which you shared is opened by me.
@taleevaalam1 Can you please check if same is happening with you?
-
Hi @taleevaalam1 , @mihirk ,
Just wanted to check, Are you getting live feed data more than 10 mins? As I am getting disconnected from socket after approx 10 mins.
Please check:
https://smartapi.angelbroking.com/topic/25/auto-closing-of-web-socketIf you could help with that.
-vishant
-
@mihirk Man i feel so stupid, i had saved the feed token in a variable and was passing "feeedToken" the string as feed Token, anyhow thanks getting the response now.
-
@taleevaalam1 I actually faced same issue that feed was not coming after these two, later found that I was not sending proper feed token and client id. Please check your message. Match it with: '{"task":"mw","channel":"nse_cm|3045","token":"' + feed_token + '","user": "' + user_id + '","acctid":"' + user_id + '"}'
-
@mihirk So what are we suppose to do after we get this tick response, how do we get the actual market feed, are we suppose to wait and market feed response gonna come eventually after the tick responise?
-
@taleevaalam1 I am using NodeJS for live feed through web socket and it is working fine. Two stock ticks you posted occurs everytime on first connection (these are just acknowledgement of successful connection) and after that we get actual market feed. So basically, market feed will come after these two ticks.
-
This post is deleted! -
@taleevaalam1 hi, can you please share a snipe of python code you are using for streaming the tick data , as i'm trying but i'm not able to get the above format data, whereas @bhaveshjain had messaged me in one of the post that there is some issue with python websocket streaming service, they are trying to fix that,
-
@bhaveshjain I was able to successfully get the web socket response for script
script: "nse_cm|2885
feed_token - I am using what i have got as a response from generate session
but the response is something like this
Receive stock ticks:: [ { ak: 'nk', task: 'cn', msg: 'cn' } ] Receive stock ticks:: [ { ak: 'nk', task: 'mw', msg: 'mw' } ]
I can not make much sense out of this data
Can you please tell me what i might be doing wrong
p.s : I ran the code on Working days only
-
Okay I got it. I need to call generateToken method after the generateSession method
-
@vishant Python
-
Hi @rjbanna,
Can you specify, which SDK you are using? (Node / Python /Java)
-
@bhaveshjain I'm able to login to the system using the smartapi but there is no feedToken in the response, only refreshToken and jwtToken is there. I checked the code on the Github and found that the API call is not returning the feedToken and without that we won't be able to get the live market feed. So please add the feedToken in the response. Thanks.