py5paisa
py5paisa copied to clipboard
how to fetch and store ohlc data from req_list=client.Request_Feed("mf","s",req_list) client.Streming_data(req_list)
- 5paisa Python SDK version:
- Python version:
- Operating System:
Description
Describe what you were trying to get done. Tell us what happened, what went wrong, and what you expected to happen.
What I Did
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
when i fetch live data it gives response with command #Live Market Feed Streaming req_list=[{ "Exch":"N","ExchType":"C","ScripCode":1660}, ] dict1=Client.Request_Feed('mf','s',req_list) client.Streming_data(dict1)
i get responce [{"Exch":"N","ExchType":"C","Token":1660,"LastRate":237.3,"LastQty":64,"TotalQty":7157532,"High":238.75,"Low":235.7,"OpenRate":236,"PClose":237.75,"AvgRate":237.11,"Time":25352,"BidQty":61,"BidRate":237.2,"OffQty":9,"OffRate":237.25,"TBidQ":1871748,"TOffQ":2784756,"TickDt":"/Date(1632900752000)/"}]
now how to store the data in a variable live_data[message["instrument"].symbol] = {"High": message["high"],"Low": message["low"],"Open": message["open"],"Ltp": message["ltp"],"Volume": message["volume"]}
Hey @arindam899, I'm facing the same problem - were you able to figure it out? Hugely appreciate any any help with this!!