wrighter / ib-scripts

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

set the dateformat to include utc offset in saved bars by default #19

Closed wrighter closed 7 months ago

wrighter commented 7 months ago

When users run the script, the first time it saves data it applies a timezone to the resulting data ok if the dateformat includes %Z. But if the file is reopened and merged on another run, the timezone name is missing, so %Z doesn't work. Using %z will persist across multiple reads and writes.

In reality, data should be stored with a utc timestamp and converted to local time in another way, but this change should at least allow the defaults to work better.