wrighter / ib-scripts

Python scripts that use the Interactive Brokers TWS API
MIT License
48 stars 19 forks source link

TWS 9.81.1 not returning full day of data for futures #5

Closed wrighter closed 1 year ago

wrighter commented 1 year ago

Since upgrading to 9.81.1 a while back, I realized pulling historical data for CME futures is only bringing back the evening session's worth of data for the day. So we we tell the API to give us 1 hour bars from midnight to midnight on 2022-09-06, it will give us the data from 17:00 to 24:00 America/Chicago. I think this has to do with overlapping sessions. If I ask for 2 days of data, it gives data from 2022-09-05 17:00 until 2022-09-06 24:00 America/Chicago.

I suspect that maybe the new historical schedule API would be of use here?

The other option is experiment with asking for smaller chunks of data and building up the full day from the smaller pieces.

HackerzWorkshop commented 1 year ago

I've also encountered the same for MQN (example: download_bars.py --security-type CONTFUT --exchange CME --start-date 20220202 MNQ), Any thoughts on how to solve this?