Market calendars
q.calendar contains exchange-session and market-time operations. Functions require an explicit ISO 10383 market identifier; qrt never assumes one market.
Use schedule to retrieve session dates with timezone-aware local opens and closes. Holidays are omitted and early closes retain their actual close time.
stockholm = q.calendar.schedule(
"2024-03-28",
"2024-04-02",
exchange="XSTO",
)The result above contains the 13:00 Stockholm close on March 28, omits the Easter holidays, and resumes at 09:00 on April 2.
closed_days = q.calendar.non_trading_days_after(
prices.index.to_series(),
exchange="XNYS",
)An early close remains a trading session. The function counts only closed calendar dates between consecutive sessions and validates every input date against the selected exchange calendar.
Back to top