Tick values are refreshing very slowly in websocket streaming.
-
Hello,
I am using SmartWebSocket() for Websocket streaming to fetch script feeds for both Indices ad Equities.It is observed that, there is a delay in tick values update and LTP is not getting reflected fastly so it's value is differing from the actual price on Angel Broking web console.
So there are 2 major questions-
- How can we sync with the current prices?
- Also what is the ideal delay time in tick values update as comparing to Angel Broking web console?
-
@J88913 ,
i am getting below error with this code. can you help.{'task': 'hb', 'channel': '', 'token': '093658357', 'user': '', 'acctid': ''}
Error info: 'ltp'
'ltp' -
@admin
can you please update me on below error? -
HI @puna123 said in Tick values are refreshing very slowly in websocket streaming.:
@J88913 ,@admin
i got the code from the link you have given but getting below error.
would you be able to help?
Error info: Handshake status 503 Service Unavailable
Handshake status 503 Service Unavailable
Error info: __on_close() takes 2 positional arguments but 4 were given
__on_close() takes 2 positional arguments but 4 were givenwe will update you on this.
-
@J88913 ,@admin
i got the code from the link you have given but getting below error.
would you be able to help?
Error info: Handshake status 503 Service Unavailable
Handshake status 503 Service Unavailable
Error info: __on_close() takes 2 positional arguments but 4 were given
__on_close() takes 2 positional arguments but 4 were given -
HI @webseos said in Tick values are refreshing very slowly in websocket streaming.:
@admin What is SFI ? What is websocket's specialty over LTP or Historical API (Daily to 1 min)
Can we get many stock's data at once by multithreading?- You need to go through below documentation to understand all terms related to web socket.
2)We only provide data for the symbol whose token are available in instrument dump file.
- You need to go through below documentation to understand all terms related to web socket.
-
@admin I saw this , filtered out stock equity info of 1522 stocks symbol and token to a JSON file, but didnot parsed FNO data yet because of too much strike prices , expiry data,
Saw different bank nifty , nifty strike, but could not find spot
Can you tell the symbol to FIND exact JSON record for NIFTY Bank NIFTY Spot -
@admin What is SFI ? What is websocket's specialty over LTP or Historical API (Daily to 1 min)
Can we get many stock's data at once by multithreading?
-
@admin Can you show a sample code to get NIFTY/ BankNifty SPOT LTP Data. I think it always same, because NIFTY spot has no expiry
Query : Also can we get LTP of a premium related to a strike / expiry , e,g NIFTY 16000 CE 26 August 2021
Can we get LIVE premium ?
-
HI @princetech1 our team is working on websocket code we will update you once it is fixed.
-
This post is deleted! -
@admin Exception while retriving IP Address,using local host IP address HTTPSConnectionPool(host='api.ipify.org', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000000003B68358>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))
__on_open################
{'task': 'cn', 'channel': 'NONLM', 'token': '090809502', 'user': 'SWWR1025', 'acctid': 'SWWR1025'}
2021-08-19 19:09:21.993348 : Start task in the background
{'task': 'hb', 'channel': '', 'token': '090809502', 'user': 'SWWR1025', 'acctid': 'SWWR1025'}=> above is the data generated after my previosly posted python code.
-
@J88913 that link is not useful=> Nothing special to get Hinted.
-
@admin I want to get spot Nifty and Not Futures.
-
@admin token = 'nifty'
task='sfi'
WS = SmartWebSocket(feedToken, CLIENT_ID)def on_tick(ws, tick):
print("Ticks: {}".format(tick))def on_open(ws):
#print("on Open")
ws.subscribe(task,token)def on_connect(ws, response):
ws.send_request(token)def on_close(ws, code, reason):
ws.stop()Assign the callbacks.
WS.on_ticks = on_tick
WS.on_connect = on_connect
WS.on_open = on_open
WS.on_close = on_closeWS.connect( )
print(WS)please check and make the neccesary update in above Code=>
-
HI @webseos To Get live feed from websocket you need to pass task as "sfi" and pass nifty as token
-
@princetech1 for the live feed python code watch link text
-
HI @webseos Please go through the instrument dump file.
https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json -
@admin What will be the code or JSON request format to get BankNifty Spot/ Nifty Spot/ Finnifty Spot
-
HI @princetech1 you can get it though websocket or ltp API.