wrighter / ib-scripts

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

Issue #5: fix to return full day for CME bars #6

Closed wrighter closed 1 year ago

wrighter commented 1 year ago

This PR fixes a couple of issues, but the main change is to remove the concept of duration from the command line arguments, and to pick it ourselves. Before, a 1 day duration with bars under 1 day would only return the night session for CME products. Changing this to be 1 day's worth of seconds for all bars under 1 day of length returns the full day.

This was also developed with a 10.19.1 of the TWS API, and so updating the code to deal with timezones was necessary.

Existing bar files should be deleted before attempting to run this, it will not necessarily merge the files well.