Skip to content
All library documents

Choosing Stock Market Calendars for Trading Systems

Article Quant Q&A · Author: André Christoffer Andersen

Summary

The document discusses where to obtain machine-readable stock exchange calendars, including holidays and early closes. The question highlights why calendar data matters for trading systems: schedules differ across markets, special closing times occur, and historical disruptions may be missing from ordinary calendar datasets. It also notes that a once-available calendar source later became unavailable, illustrating the maintenance risk of relying on scraped web pages.

One response recommends a commercial calendar service for production use, while another names a Python market-calendar library as a possible option. The exchange does not compare coverage, accuracy, update practices, licensing, or historical completeness across these sources. It also cautions that unusual closures tied to major events may not appear in standard exchange calendars. Anyone selecting a source should check that its market coverage and special-session history fit the intended use.

Key ideas

  • Exchange calendars need to represent holidays and early closing sessions.
  • Scraping a web page can create reliability and long-term maintenance problems.
  • A commercial provider is suggested for production calendar data.
  • A Python library is suggested as another source, though coverage may omit exceptional closures.

Tags

Full text
# Reliable stockmarket holiday, open and close time dataset/api?


# Reliable stockmarket holiday, open and close time dataset/api?












Is there a reliable machine readable source of stock market holiday calendars?

I found this source: https://eresearch.fidelity.com/eresearch/markets_sectors/global/holidayCalendar.jhtml

I could scrape it, but honestly, I have my doubts about it staying well formatted and conforming over time, or even exist at all over time. Also it doesn't seem to have historic data, including abnormal close times like 9/11.

A good thing about it is that it includes special close times. Some markets close early on some days, notably Stockholm has a bunch of them.

2020-06-08 Edit: My worries turned out to be warranted. The source now just reads:

> International Holiday Calendar permanently unavailable.

## Answer by FinanceGuyThatCantCode (score 2, accepted)

https://quant.stackexchange.com/a/33890

The best most comprehensive (and therefore not free) calendar service I know of is at Swaps Monitor - sounds very fixed income-y, but they also have stock market calendar data. If you are doing something in a production environment, this is the sort of thing you want.

http://www.financialcalendar.com/Data/Holidays/Overview

## Answer by misantroop (score 2)

https://quant.stackexchange.com/a/33885

pandas_market_calendars should do the job. I think there aren't any market calendars that feature 9/11 or the 2012 storm days as holidays.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.