1 minute historical data for ETF

Anuj2343
Hi,

I wanted to know if the database contains 1 minute historical data of all ETF listed right now. Some of them are illiquid and not really studied so that is why I wanted to know if the data exists before I buy the subsricption.

Also, will I breach any Zerodha request limit if I download 1 minute historical data of any ETF for the last three years? Asking since 3 year 1 minute data can be large.

Thank you
Tagged:
  • rakeshr
    @Anuj2343
    I wanted to know if the database contains 1 minute historical data of all ETF listed right now. Some of them are illiquid and not really studied so that is why I wanted to know if the data exists before I buy the subsricption.
    Yeah, we do have minute candle data for ETF.
    Also, will I breach any Zerodha request limit if I download 1 minute historical data of any ETF for the last three years? Asking since 3 year 1 minute data can be large.
    At a time, for a 1-minute candle, you will be able to fetch a maximum of 60 days of data. You need to fetch it in the loop for more number data.
  • Anuj2343
    Thank you for your response. So I can fetch data for 2 - 3 years, but I'll have to run the extract data command after every 60 days have been downloaded?
  • sujith
    Yes, you need to run fetch data in a loop with 60 days interval.
  • Anuj2343
    Alright, I finally bought the subscription and was able to download data till 60 days as you mentioned. However, I need help as to how can I get data in a loop as I'm very new to Python.

    Here's the code I'm using

    data=kite.historical_data(instrument_token=5484289,from_date='2020-03-01', to_date='2020-04-01', interval='minute')
    with open("historical_data.csv", "w",newline='') as output:
    writer = csv.writer(output)
    writer.writerow(['Date','open','High','Low','close','volume'])
    for value in data:
    writer.writerow([value['date'],value['open'],value['high'],value['low'],value['close'],value['volume']])

    Please help me with regards to the loop!
  • Professor_Severus
    Please let me know if you got the answer for this @Anuj2343
Sign In or Register to comment.