I am trying to get last month High & Low for all FNO stocks (around 170 stocks). Now considering API Rate limit, how we can do the same with Fyers API? Anybody does have any idea?
looking at your question, you need to learn to store data locally at your end.
for 170 stocks, if you download data daily, it will be 170 hits per day for 10K limit that is more than enough.
To start also, you get around 100 days daily history(i think it is 1 year in daily but jave not checked recently) and backfill should be enough with multiple calls.
Hi @mpashis-ol4
You can hit the history API for it.
Will I get monthly OHLC or I need to calculate it in other way?
Also I am facing some peculiar issues. Trying to get the OHLC of last 15min candle but not getting the correct data everytime, so what could be the best way to get last 15min OHLC correctly by every 15min? Pls help
read my first post, you have to store data locally at lower timeframe and then resample it for higher timeframe. You seem to be using history API to serve like quote api. or realtime data
But you are not explaining your setup so It is not useful to help.
Hi @mpashis-ol4
You can make your own dataset based on small time frame.
Let say you have data of one minute candle so based on the candles you can make 5 minutes 10 minutes 20 minutes
n minutes data based on your requirements.
How you can do that please google for the same.
Got your point, but my question is suppose I need get OHLC data of 915 candle , so when will I place the call to get the OHLC? Sometime it returns 2 rows of one of the completed candle and another of the running candle, here I have applied a sleep of 2 sec so calling at 9:30:02 to get the 15min last candle data which started at 9:15
Yes I am calling the history API at starting of the candle to get the last completed candle data, sometime it gives correct data but some time it returns with 2 rows. One with last candle data and another with the running candle data
@mpashis-ol4
What exactly you want to do tell me
I will give you solution.
thats what i am saying, it is wrong approach.
otherwise filter the data so you can discard bad candle based on current system time and data rec’d
Suppose I need to build a strategy where I need the OHLC of last 15min candle which is closed already, not the candle which is still forming. So once a candle get close I need the OHLC each time
hi @mpashis-ol4
Hit the request after 2 or 3 second , you will get the data of for that 2 or 3 second. Simply remove it
You get the data of previous closed 15 minute candle.
That’s all
Kindly let me know if you need help
If you will request on 9:30:03
then you will get two 15 minute candle data
One is 9:15 to 9:30 and second 9:30 to 9:45(currently it will be 9:30:03 means only for three second).
You have to remove last candle data from your data structure that’s all
You will get the data for 9:15 candle.
The same I am already doing and taking the 1st row only, but the problem is sometime it returns only one row only.
No way @mpashis-ol4
Please use APIv3 ,
Even I am also using same logic for entire day. It works fine.