The regular_market_times attribute is a dictionary containing moments in a trading day.
Key requirements for the dictionary:
- Must contain
market_open and market_close. - If a break exists, it must contain
break_start and break_end (only one break is supported). - Each entry is a tuple of tuples in the format
(first_date_used, time[, offset]). - The first tuple's date should be
None to mark the start. Subsequent tuples use the date when the time was first used. - Dates must be in ascending order.
Common keys include pre, market_open, market_close, and post.
print("The original NYSE calendar: \n", nyse.regular_market_times)
# Example output structure:
# ProtectedDict({'pre': ((None, datetime.time(4, 0)),),
# 'market_open': ((None, datetime.time(10, 0)), ('1985-01-01', datetime.time(9, 30))), ...})
# To get all historical time changes for a specific market time:
print(nyse.get_time("market_close", all_times=True))