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

Update market_calendar.py #332

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas_market_calendars/market_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ def open_at_time(self, schedule, timestamp, include_close=False, only_rth=False)

# When post follows market_close, market_close should not be considered a close
day.loc[day.eq("market_close") & day.shift(-1).eq("post")] = "market_open"
day = day.replace(self.open_close_map)
day = day.map(lambda x : self.open_close_map.get(x) if x in self.open_close_map.keys() else x)

if include_close:
below = day.index < timestamp
Expand Down
Loading