Data Retrieval

I am unable to retrieve the past 5years data for 5minutes. It says there is a limit for 100days.
  • MAG
    MAG edited October 2023
    You have to do it in batches
    in python you would do something like

    import datetime

    startdate = datetime.datetime( 2008, 10, 1, 9, 15, 0)

    while True:
    enddate = startdate + datetime.timedelta(days=100)

    # fetch historical data here for 100 days from startdate to enddate.

    # This next line will set the start date for next iteration to the next date after enddate.
    startdate = enddate + datetime.timedelta(days=1)

  • kpushp
    @MAG Thank You!!
This discussion has been closed.