Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Loaded Historical Data Ruquest
Hello all,
?
I'm trying to get 1-hr and 15-min data for an ETF going back 10 years but the most the API will get is 7 years for 1-hr bars and 2 years for 15-min bars. Longer timeframe requests keep timing out.
?
IB's support told me there's no restriction in TWS or the IB API, and that I may want to check if the ib_async wrapper is causing the timeout, especially because it's a lot of data and the request will take time. Anyone know if this could be the case, and/or how to manage it?
?
Secondly, I tried to get smaller chunks of data (1 yr at a time) but that request also timed out. Below is my code, would love help confirming if it looks correct. The intent of this request is to get data starting 10 years ago (12/2/2014) until 12/2/1025.
?
Thank you so much!
?
ib.reqHistoricalData( ? ? ? ? contract, ? ? ? ? endDateTime='20151202 23:59:59', ? ? ? ? durationStr='10 Y', ? ? ? ? barSizeSetting='15 mins', ? ? ? ? whatToShow='TRADES', ? ? ? ? useRTH=True, ? ? ? ? keepUpToDate=False, ? ? ? ? formatDate=2) |
开云体育Your code has it starting at 2015-12-02 and trying to go back to 2005-12-02.? The end date can be confusing, it runs from the end date and then goes back in time 10 years.? You would be better to start at current date do 10 years and then move the date to 2014-12-02 etc. I have also retrieved data using similar code and using 30 years, but that was for day bars. You could also use a loop and get 1 year at a time for the 1hr or 15m bars lowerining the endate by a year each loop.? Check for bar data before looping again so you don't waste cycles not getting data for one stock that listed in 2010 versus one from 1980. If you still have trouble I can help work through the code -------- Original message -------- From: "R Malhotra via groups.io" <rachan.malhotra@...> Date: 2024-12-02 7:50 p.m. (GMT-08:00) Subject: [ib-async] Loaded Historical Data Ruquest Hello all,
?
I'm trying to get 1-hr and 15-min data for an ETF going back 10 years but the most the API will get is 7 years for 1-hr bars and 2 years for 15-min bars. Longer timeframe requests keep timing out.
?
IB's support told me there's no restriction in TWS or the IB API, and that I may want to check if the ib_async wrapper is causing the timeout, especially because it's a lot of data and the request will take time. Anyone know if this could be the case, and/or how to manage it?
?
Secondly, I tried to get smaller chunks of data (1 yr at a time) but that request also timed out. Below is my code, would love help confirming if it looks correct. The intent of this request is to get data starting 10 years ago (12/2/2014) until 12/2/1025.
?
Thank you so much!
?
ib.reqHistoricalData(
? ? ? ? contract, ? ? ? ? endDateTime='20151202 23:59:59', ? ? ? ? durationStr='10 Y', ? ? ? ? barSizeSetting='15 mins', ? ? ? ? whatToShow='TRADES', ? ? ? ? useRTH=True, ? ? ? ? keepUpToDate=False, ? ? ? ? formatDate=2) |
to navigate to use esc to dismiss