Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: generalize values for before_trading_start_minutes #222

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zhiyisun
Copy link

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.

zhiyisun and others added 2 commits September 24, 2023 20:07
Use open_times and timezone info from trading_calendar for
before_trading_start_minutes. Replace the original 8:45 "US/Eastern".

Signed-off-by: Zhiyi Sun <[email protected]>
exchange_calendar is migrating from pytz to zoneinfo. Using str(self.trading_calendar.tz) can support both pytz and zoneinfo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant