OpenApi-5p / py5paisa

Official Python SDK for 5paisa APIs natively written in VB .NET
https://5paisa.github.io
93 stars 68 forks source link

how to fetch and store ohlc data from req_list=client.Request_Feed("mf","s",req_list) client.Streming_data(req_list) #100

Open arindam899 opened 3 years ago

arindam899 commented 3 years ago

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.
arindam899 commented 3 years ago

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"]}

gaucow commented 2 years ago

Hey @arindam899, I'm facing the same problem - were you able to figure it out? Hugely appreciate any any help with this!!