stefan-jansen / zipline-reloaded

Zipline, a Pythonic Algorithmic Trading Library
https://zipline.ml4trading.io
Apache License 2.0
1.03k stars 199 forks source link

fix: generalize values for before_trading_start_minutes #222

Open zhiyisun opened 9 months ago

zhiyisun commented 9 months ago

In original zipline, the before_trading_start_minutes is fixed as 8:45AM US/Eastern timezone. But that won't fit if the security market is in different location. Using (open time - 45min) and timezone info to support different timezone markets.

One tricky is exchange_calendars is moving from pytz to zoneinfo. It seems str() is the best function to convert timezone (expressed in both pytz and zoneinfo) to timezone string.