erdewit / ib_insync

Python sync/async framework for Interactive Brokers API
BSD 2-Clause "Simplified" License
2.85k stars 772 forks source link

Check contract details has time zone ID #663

Open djkelleher opened 11 months ago

djkelleher commented 11 months ago

Contracts about to expire may not have tradingHours, liquidHours, and timeZoneId set. This was causing an error when _parseSessions is called:

Exception has occurred: ValueError
ZoneInfo keys must be normalized relative paths, got: 

A simple way to avoid the error would be to check if the argument string is empty.