Fetching historical futures data from IBKR

Hello,
I’m trying to get 10 years of 15min historical data for continuous futures contracts from IBKR using the .reqHistoricalData(…) method. But I’m facing some problems.

When I ask for the whole history in a single request I get a timeout error due to the number of requests.
But when I try to request it in chunks, moving backwards using the endDateTime=‘’ " parameter I get the error:
Error 10339, reqId 85: Setting end date/time for continuous future security type is not allowed

Is there a way I can achieve this?

Hi Santiago,

One way to achieve this can be manually constructing a continuous time series by aggregating data from individual expired futures contracts. Use reqContractDetails() with a defined Contract object (including includeExpired=True) to obtain all related futures contracts. For each contract, create a new Contract object, set includeExpired=True, and use reqHistoricalData() to fetch 15-minute interval data. Finally, aggregate the data chronologically, handling rollovers.

However, there might be other approaches to do the same for which I would suggest you to reach out to the IBKR support team here and they might be able to help you with the same.