pandas_market_calendars package

Submodules

pandas_market_calendars.calendar_registry module

pandas_market_calendars.calendar_registry.get_calendar(name, open_time=None, close_time=None)

Retrieves an instance of an MarketCalendar whose name is given.

Parameters:
  • name – The name of the MarketCalendar to be retrieved.
  • open_time – Market open time override as datetime.time object. If None then default is used.
  • close_time – Market close time override as datetime.time object. If None then default is used.
Returns:

MarketCalendar of the desired calendar.

pandas_market_calendars.calendar_registry.get_calendar_names()

All Market Calendar names and aliases that can be used in “factory” :return: list(str)

pandas_market_calendars.calendar_registry.times

Returns a optional list of tuples of (start_date, break_end_time). If the break end time is constant throughout the calendar, use None for the start_date. If there is no break, return None.

pandas_market_calendars.calendar_utils module

Utilities to use with market_calendars

pandas_market_calendars.calendar_utils.convert_freq(index, frequency)

Converts a DateTimeIndex to a new lower frequency

Parameters:
  • index – DateTimeIndex
  • frequency – frequency string
Returns:

DateTimeIndex

pandas_market_calendars.calendar_utils.merge_schedules(schedules, how='outer')

Given a list of schedules will return a merged schedule. The merge method (how) will either return the superset of any datetime when any schedule is open (outer) or only the datetime where all markets are open (inner)

CAVEATS:
  • This does not work for schedules with breaks, the break information will be lost.
  • Onlu “market_open” and “market_close” are considered, other market times are not yet supported.
Parameters:
  • schedules – list of schedules
  • how – outer or inner
Returns:

schedule DataFrame

pandas_market_calendars.class_registry module

class pandas_market_calendars.class_registry.ProtectedDict(*args, **kwargs)

Bases: dict

copy() → a shallow copy of D
class pandas_market_calendars.class_registry.RegisteryMeta(name, bases, attr)

Bases: type

Metaclass used to register all classes inheriting from RegisteryMeta

pandas_market_calendars.exchange_calendar_asx module

class pandas_market_calendars.exchange_calendar_asx.ASXExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Open Time: 10:00 AM, Australia/Sydney Close Time: 4:10 PM, Australia/Sydney

Regularly-Observed Holidays: - New Year’s Day (observed on Monday when Jan 1 is a Saturday or Sunday) - Australia Day (observed on Monday when Jan 26 is a Saturday or Sunday) - Good Friday (two days before Easter Sunday) - Easter Monday (the Monday after Easter Sunday) - ANZAC Day (April 25) - Queen’s Birthday (second Monday in June) - Christmas Day (December 25, Saturday/Sunday to Monday) - Boxing Day (December 26, Saturday to Monday, Sunday to Tuesday)

Regularly-Observed Early Closes: - Last Business Day before Christmas Day - Last Business Day of the Year

aliases = ['ASX']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(16, 10)),), 'market_open': ((None, datetime.time(10, 0)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_bmf module

class pandas_market_calendars.exchange_calendar_bmf.BMFExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for BM&F BOVESPA

Open Time: 10:00 AM, Brazil/Sao Paulo Close Time: 4:00 PM, Brazil/Sao Paulo

Regularly-Observed Holidays: - Universal Confraternization (New year’s day, Jan 1) - Sao Paulo City Anniversary (Jan 25) - Carnaval Monday (48 days before Easter) - Carnaval Tuesday (47 days before Easter) - Passion of the Christ (Good Friday, 2 days before Easter) - Corpus Christi (60 days after Easter) - Tiradentes (April 21) - Labor day (May 1) - Constitutionalist Revolution (July 9 after 1997) - Independence Day (September 7) - Our Lady of Aparecida Feast (October 12) - All Souls’ Day (November 2) - Proclamation of the Republic (November 15) - Day of Black Awareness (November 20 after 2004) - Christmas (December 24 and 25) - Day before New Year’s Eve (December 30 if NYE falls on a Saturday) - New Year’s Eve (December 31)

aliases = ['BMF']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(16, 0)),), 'market_open': ((None, datetime.time(10, 1)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
special_opens

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_cfe module

pandas_market_calendars.exchange_calendar_cme module

class pandas_market_calendars.exchange_calendar_cme.CMEAgricultureExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for CME for Agriculture products

Open Time: 5:00 PM, America/Chicago Close Time: 5:00 PM, America/Chicago

Regularly-Observed Holidays: - New Years Day - Good Friday - Christmas

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['CME_Agriculture', 'CBOT_Agriculture', 'COMEX_Agriculture', 'NYMEX_Agriculture']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(17, 0)),), 'market_open': ((None, datetime.time(17, 1), -1),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
class pandas_market_calendars.exchange_calendar_cme.CMEBondExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for CME for Interest Rate and Bond products

The Holiday calendar is different between the open outcry trading floor hours and GLOBEX electronic trading hours. This calendar attempts to be accurate for the GLOBEX holidays and hours from approx 2010 onward.

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['CME_Rate', 'CBOT_Rate', 'CME_InterestRate', 'CBOT_InterestRate', 'CME_Bond', 'CBOT_Bond']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(16, 0)),), 'market_open': ((None, datetime.time(17, 0), -1),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_closes_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
class pandas_market_calendars.exchange_calendar_cme.CMEEquityExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for CME for Equity products

Open Time: 6:00 PM, America/New_York / 5:00 PM Chicago Close Time: 5:00 PM, America/New_York / 4:00 PM Chicago Break: 4:15 - 4:30pm America/New_York / 3:15 - 3:30 PM Chicago

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['CME_Equity', 'CBOT_Equity']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'break_end': ((None, datetime.time(15, 30)),), 'break_start': ((None, datetime.time(15, 15)),), 'market_close': ((None, datetime.time(16, 0)),), 'market_open': ((None, datetime.time(17, 0), -1),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_eurex module

class pandas_market_calendars.exchange_calendar_eurex.EUREXExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for EUREX

aliases = ['EUREX']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(17, 30)),), 'market_open': ((None, datetime.time(9, 0)),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_hkex module

class pandas_market_calendars.exchange_calendar_hkex.HKEXExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for Hong Kong Stock Exchange

Open Time: 9:30 AM, Asia/Shanghai LUNCH BREAK :facepalm: : 12:00 AM - 1:00 PM Asia/Shanghai Close Time: 4:00 PM, Asia/Shanghai

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['HKEX']
name

Name of the market

Returns:string name
regular_holidays

Rules are guesses based on observations of recent year. Rectify accordingly once the next year’s holidays arrangement is published by the government.

regular_market_times = {'break_end': ((None, datetime.time(13, 0)),), 'break_start': ((None, datetime.time(12, 0)),), 'market_close': ((None, datetime.time(16, 0)),), 'market_open': ((None, datetime.time(9, 30)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
pandas_market_calendars.exchange_calendar_hkex.process_date(dt, mapping=None, func=None, delta=None, offset=None)
pandas_market_calendars.exchange_calendar_hkex.process_queen_birthday(dt)

pandas_market_calendars.exchange_calendar_ice module

class pandas_market_calendars.exchange_calendar_ice.ICEExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for ICE US.

Open Time: 8pm, US/Eastern Close Time: 6pm, US/Eastern

https://www.theice.com/publicdocs/futures_us/ICE_Futures_US_Regular_Trading_Hours.pdf # noqa

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['ICE', 'ICEUS', 'NYFE']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(18, 0)),), 'market_open': ((None, datetime.time(20, 1), -1),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_jpx module

class pandas_market_calendars.exchange_calendar_jpx.JPXExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for JPX

Open Time: 9:31 AM, Asia/Tokyo LUNCH BREAK :facepalm: : 11:30 AM - 12:30 PM Asia/Tokyo Close Time: 4:00 PM, Asia/Tokyo

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['JPX']
name

Name of the market

Returns:string name
regular_early_close = datetime.time(13, 0)
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'break_end': ((None, datetime.time(12, 30)),), 'break_start': ((None, datetime.time(11, 30)),), 'market_close': ((None, datetime.time(15, 0)),), 'market_open': ((None, datetime.time(9, 0)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_lse module

class pandas_market_calendars.exchange_calendar_lse.LSEExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for the London Stock Exchange

Open Time: 8:00 AM, GMT Close Time: 4:30 PM, GMT

Regularly-Observed Holidays: - New Years Day (observed on first business day on/after) - Good Friday - Easter Monday - Early May Bank Holiday (first Monday in May) - Spring Bank Holiday (last Monday in May) - Summer Bank Holiday (last Monday in August) - Christmas Day - Dec. 27th (if Christmas is on a weekend) - Boxing Day - Dec. 28th (if Boxing Day is on a weekend)

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['LSE']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(16, 30)),), 'market_open': ((None, datetime.time(8, 0)),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_nyse module

class pandas_market_calendars.exchange_calendar_nyse.NYSEExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for NYSE from 1885-01-01
  • Note: DJIA was first recorded 1885-02-16

REFERENCES: - https://web.archive.org/web/20141224054812/http://www.nyse.com/about/history/timeline_trading.html - https://www.marketwatch.com/story/a-brief-history-of-trading-hours-on-wall-street-2015-05-29 - http://www.ltadvisors.net/Info/research/closings.pdf - https://github.com/rsheftel/pandas_market_calendars/files/6827110/Stocks.NYSE-Closings.pdf

NYSE OVERVIEW: - 1792: 5 securities traded - 1871: Continuous trading begins - 1885 to 1887: trading hours Mon-Sat 10am to variable 2pm thru 4pm (coded as 3pm) - 1887: trading hours Mon-Fri 10am-3pm Sat 10am-noon - 1952-09-29: trading hours Mon-Fri 10am-3:30pm,

  • Sat trading removed after Sept 27
  • Last effective Saturday traded was May 24, 1952
  • 1974: trading hours Mon-Fri 10am-4pm
  • 1985: trading hours Mon-Fri 9:30am-4pm
  • New Years Day (observed on monday when Jan 1 is a Sunday)
  • Martin Luther King Jr. Day (3rd Monday in January, only after 1998)
  • Lincoln’s Birthday (February 12th, only before 1954 starting in 1896)
  • Washington’s Birthday (February 22nd, before 1971 with rule change in 1964)
  • Washington’s Birthday (aka President’s Day, 3rd Monday in February, after 1970)
  • Good Friday (two days before Easter Sunday)
  • Memorial Day (May 30th, before 1970, with rule change in 1964)
  • Memorial Day (last Monday in May, after 1970)
  • Independence Day (July 4th Sunday to Monday, before 1954)
  • Independence Day (observed on the nearest weekday to July 4th, after 1953)
  • Election Day (First Tuesday starting on November 2nd, between 1848 and 1967)
  • Election Day (Every four years, first Tuesday starting on November 2nd, between 1968 and 1980)
  • Veterans Day (November 11th, between 1934 and 1953)
  • Columbus Day (October 12th, before 1954)
  • Labor Day (first Monday in September)
  • Thanksgiving (last Thursday in November, before 1939)
  • Thanksgiving (second to last Thursday in November, between 1939 and 1941)
  • Thanksgiving (fourth Thursday in November, after 1941)
  • Christmas (December 25th, Sunday to Monday, before 1954)
  • Christmas (observed on nearest weekday to December 25, after 1953)
  • July 3rd (Mondays, Tuesdays, and Thursdays, 1995 onward)
  • July 5th (Fridays, 1995 onward, except 2013)
  • Christmas Eve (except on Fridays, when the exchange is closed entirely)
  • Day After Thanksgiving (aka Black Friday, observed from 1992 onward)

NOTE: Until 1993, the standard early close time for the NYSE was 2:00 PM. From 1993 onward, it has been 1:00 PM.

  • Columbus Day (after 1953)
  • Armistice/Veterans Day (after 1953)

begin reference: https://github.com/rsheftel/pandas_market_calendars/files/6827110/Stocks.NYSE-Closings.pdf - Closed on Aug 8, 1885 (Sat): President Ulysses S. Grant funeral - Closed on Jul 2, 1887 (Sat): Saturday before Independence Day - Closed on Dec 24, 1887 (Sat): Christmas Eve - Closed on Mar 12-13, 1888 (Mon-Tue): Blizzard of 1888 - Closed on Sep 1, 1888 (Sat): Saturday before Labor Day - Closed on Nov 30, 1888 (Fri): Friday after Thanksgiving - Closed on Apr 29 - May 1, 1889 (Mon-Wed): Centennial celbration of Washington’s inauguration - Closed on Jul 5, 1890 (Sat): Saturday after Independence Day - Closed on Dec 26, 1891 (Sat): Saturday after Christmas - Closed on Jul 2, 1892 (Sat): Saturday before Independence Day - Closed on Oct 12, 1892 (Wed) Columbian Celebration (Columbus discovery of America) - Closed on Oct 21-22, 1892 (Fri-Sat): Columbian Celebration - Closed on Apr 27, 1893 (Thu): Columbian Celebration - Closed on Dec 26, 1896 (Sat): Saturday after Christmas - Closed on Apr 27, 1897 (Tue): Grant’s birthday - Closed on May 4, 1898 (Wed): NYC Charter Day - Closed on Jul 2, 1898 (Sat): Saturday before Independence Day - Closed on Aug 20, 1898 (Sat): Welcome of naval commanders - Closed on Sep 3, 1898 (Sat): Saturday before Labor Day - Closed on Dec 24, 1898 (Sat): Saturday before Christmas - Closed on Feb 11, 1899 (Sat): Saturday before Lincoln’s birthday - Closed on May 29, 1899 (Mon): Monday before Decoration Day - Closed on Jul 3, 1899 (Mon): Monday before Independence Day - Closed on Sep 29-30, 1899 (Fri-Sat): Admiral Dewey Celebration - Closed on Nov 25, 1899 (Sat): Funeral of Vice-President Garret A. Hobart - Closed on Apr 14, 1900 (Sat): Saturday after Good Friday - Closed on Sep 1, 1900 (Sat): Saturday before Labor Day - Closed on Dec 24, 1900 (Mon): Christmas Eve - Closed on Feb 2, 1901 (Sat): Funderal of Queen Victoria of England - Closed on Feb 23, 1901 (Sat): Saturday after Washington’s birthday - Closed on Apr 6, 1901 (Sat): Saturday after Good Friday - Closed on Apr 27, 1901 (Sat): Moved to temporary quarters in Produce Exchange - Closed on May 11, 1901 (Sat): Enlarged temporary quarters in Produce Exchange - Closed on Jul 5-6, 1901 (Fri-Sat): Days after Independence Day - Closed on Aug 31, 1901 (Sat): Saturday before Labor Day - Closed on Sep 14, 1901 (Sat): Death of President William McKinley - Closed on Sep 19, 1901 (Thu): Funeral of President William McKinley - Closed on Mar 29, 1902 (Sat): Saturday after Good Friday - Closed on May 31, 1902 (Sat): Saturday after Decoration Day - Closed on Jul 5, 1902 (Sat): Saturday after Independence Day - Closed on Aug 9, 1902 (Sat): Coronation of King Edward VII of England - Closed on Aug 30, 1902 (Sat): Saturday before Labor Day - Closed on Feb 21, 1903 (Sat): Saturday before Washington’s birthday - Closed on Apr 11, 1903 (Sat): Saturday after Good Friday - Closed on Apr 22, 1903 (Wed): Opening of the new NYSE building - Closed on Sep 5, 1903 (Sat): Saturday before Labor Day - Closed on Dec 26, 1903 (Sat): Saturday after Christmas - Closed on May 28, 1904 (Sat): Saturday before Decoration Day - Closed on Jul 2, 1904 (Sat): Saturday before Independence Day - Closed on Sep 3, 1904 (Sat): Saturday before Labor Day - Closed on Dec 24, 1904 (Sat): Saturday before Christmas - Closed on Apr 22, 1905 (Sat): Saturday after Good Friday - Closed on Feb 23, 1907 (Sat): Saturday after Washington’s birthday - Closed on Mar 30, 1907 (Sat): Saturday after Good Friday - Closed on Aug 31, 1907 (Sat): Saturday before Labor Day - Closed on Apr 18, 1908 (Sat): Saturday after Good Friday - Early Close 1pm on Jun 25, 1908 (Fri): Former President Grover Cleveland funeral - Closed on Sep 5, 1908 (Sat): Saturday before Labor Day - Closed on Dec 26, 1908 (Sat): Saturday after Christmas - Closed on Feb 13, 1909 (Sat): Saturday after Lincoln’s birthday - Closed on Apr 10, 1909 (Sat): Saturday after Good Friday - Closed on May 29, 1909 (Sat): Saturday before Decoration Day - Closed on Jul 3, 1909 (Sat): Saturday before Independence Day - Closed on Sep 4, 1909 (Sat) Saturday before Labor Day - Closed on Sep 25, 1909 (Sat): Reception Day of the Hudson-Fulton Celebration - Closed on Mar 26, 1910 (Sat): Saturday after Good Friday - Early Close 11am on May 7, 1910 (Sat): King Edward VII of England Death - Late Open 12pm on May 20, 1910 (Fri): King Edward VII of England Funeral - Closed on May 28, 1910 (Sat): Saturday before Decoration Day - Closed on Jul 2, 1910 (Sat): Saturday before Independence Day - Closed on Sep 3, 1910 (Sat): Saturday before Labor Day - Closed on Dec 24, 1910 (Sat): Saturday before Christmas - Closed on Apr 15, 1911 (Sat): Saturday after Good Friday - Closed on Sep 2, 1911 (Sat): Saturday before Labor Day - Closed on Dec 23, 1911 (Sat): Saturday before Christmas - Closed on Aug 31, 1912 (Sat): Saturday before Labor Day - Closed on Nov 2, 1912 (Sat): Vice-President James S. Sherman funeral - Closed on Mar 22, 1913 (Sat): Saturday after Good Friday - Late Open 12pm on Apr 14, 1913 (Mon): JP Morgan funeral - Closed on May 31, 1913 (Sat): Saturday after Decoration Day - Closed on Jul 5, 1913 (Sat): Saturday after Independence Day - Closed on Aug 30, 1913 (Sat): Saturday before Labor Day - Late Open 12pm on Sep 22, 1913 (Mon): Mayor William J. Gaynor funeral - Closed on Jul 31-Dec 11, 1914: Pending outbreak of World War I.

  • Bonds reopn Nov 28, 1914 for limited trading with restrictions
  • Stocks (limited in number) reopen Dec 12, 1914 with restrictions
  • Stocks (all stocks) reopen Dec 14, 1914 with restrictions
  • Restrictions removed on Apr 1, 1915
  • Closed on Dec 30, 1916 (Sat): Saturday before New Year’s Day
  • Closed on Jun 5, 1917 (Tue): Draft Registraion Day
  • Closed on Aug 4, 1917 (Sat): Heat
  • Early Close 12pm on Aug 29, 1917 (Wed): Parade of National Guard
  • Closed on Sep 1, 1917 (Sat): Saturday before Labor Day
  • Closed on Oct 13, 1917 (Sat): Saturday after Columbus Day
  • Early Close 12pm on Oct 24, 1917 (Wed): Liberty Day
  • Closed on Jan 28, 1918 (Mon): Heatless day
  • Closed on Feb 4, 1918 (Mon): Heatless day
  • Closed on Feb 11, 1918 (Mon): Heatless day
  • Early Close 12pm on Apr 26, 1918 (Fri): Liberty Day
  • NOT IMPLEMENTED: Break from 11am to 12pm on Jul 11, 1918 (Thu): Former Mayor John Purroy Mitchell funeral
  • Closed on Sep 12, 1918 (Thu): Draft registration day
  • Early Close 2:30pm on Nov 7, 1918 (Thu): False armistice report
  • Closed on Nov 11, 1918 (Mon): Armistice signed
  • Early Close 12:30pm on Jan 7, 1919 (Tue): Former President Theodore Roosevelt funeral
  • Closed on Mar 25, 1919 (Tue): Homecoming of 27th Division
  • Closed on May 6, 1919 (Tue): Parade of 77th Division
  • Closed on May 31, 1919 (Sat): Saturday after Decoratin Day
  • Closed on Jul 5, 1919 (Sat): Saturday after Independence Day
  • Closed on Jul 19, 1919 (Sat): Heat and backlog catch up
  • Closed on Aug 2, 1919 (Sat): Backlog catch up
  • Closed on Aug 16, 1919 (Sat): Backlog catch up
  • Closed on Aug 30, 1919 (Sat): Saturday before Labor Day
  • Closed on Sep 10, 1919 (Wed): Return of General John J. Pershing
  • Late Open 10:30am on Dec 30, 1919 (Tue): Traffic block
  • Late Open 10:30am on Feb 6, 1920 (Fri): Traffic block
  • Closed on Apr 3, 1920 (Sat): Saturday after Good Friday
  • Closed on May 1, 1920 (Sat): Many firms changed office locations
  • Closed on Jul 3, 1920 (Sat): Saturday before Independence Day
  • Closed on Sep 4, 1920 (Sat): Saturday before Labor Day
  • Early Close 12pm on Sep 16, 1920 (Thu): Wall Street explosion
  • Closed on May 28, 1921 (Sat): Saturday before Decoration Day
  • Closed on Jul 2, 1921 (Sat): Saturday before Independence Day
  • Late Open 1pm on Aug 2, 1921 (Tue): Fire in annunciator board
  • Closed on Sep 3, 1921 (Sat): Saturday before Labor Day
  • Closed on Dec 23, 1922 (Sat): Saturday before Christmas
  • Closed on Aug 3, 1923 (Fri): President Warren G. Harding death
  • NOT IMPLEMENTED: Break 11am to 12:30pm on Aug 8, 1923 (Wed): President Warren G. Harding funeral
  • Closed on Aug 10, 1923 (Fri): President Warren G. Harding funeral
  • Early Close 12:30pm on Feb 6, 1924 (Wed): Former President Woodrow Wilson funderal
  • Closed on May 31, 1924 (Sat): Saturday after Decoration Day
  • Late Open 10:45am on Jan 24, 1925 (Sat): Eclipse of sun
  • Early Close 2:30pm on Sep 18, 1925 (Fri): Seymour L. Cromwell funeral (former NYSE president)
  • Closed on Dec 26, 1925 (Sat): Saturday after Christmas
  • Closed on May 29, 1926 (Sat): Saturday before Decoration Day
  • Closed on Jul 3, 1926 (Sat): Saturday before Independence Day
  • Closed on Sep 4, 1926 (Sat): Saturday before Labor Day
  • Closed on Jun 13, 1927 (Mon): Colonel Charles A. Lindberg parade
  • Closed on Apr 7, 1928 (Sat): Backlog catch up
  • Closed on Apr 21, 1928 (Sat): Backlog catch up
  • Closed on May 5, 1928 (Sat): Backlog catch up
  • Closed on May 12, 1928 (Sat): Backlog catch up
  • Closed on May 19, 1928 (Sat): Backlog catch up
  • Early Closes May 21-25, 1928 (Mon-Fri): Backlog catch up
  • Closed on May 26, 1928 (Sat): Backlog catch up
  • Closed on Nov 24, 1928 (Sat): Backlog catch up
  • Closed on Feb 9, 1929 (Sat): Backlog catch up
  • Closed on Feb 23, 1929 (Sat): Saturday after Washington’s birthday
  • Closed on Mar 30, 1929 (Sat): Saturday after Good Friday
  • Closed on Aug 31, 1929 (Sat): Saturday before Labor Day
  • Late Open 12pm on Oct 31, 1929 (Thu): Backlog catch up and relieve personnel
  • Closed on Nov 1-2, 1929 (Fri-Sat): Backlog catch up and relieve personnel
  • Early Closes 1pm on Nov 6-8, 1929 (Wed-Fri): Backlog catch up and relieve personnel
  • Closed on Nov 9, 1929 (Sat): Backlog catch up and relieve personnel
  • Early Closes 1pm on Nov 11-15, 1929 (Mon-Fri): Backlog catch up and relieve personnel
  • Closed on Nov 16, 1929 (Sat): Backlog catch up and relieve personnel
  • Closed on Nov 18-22, 1929 (Mon-Fri): Backlog catch up and relieve personnel
  • Closed on Nov 23, 1929 (Sat): Backlog catch up and relieve personnel
  • Closed on Nov 29-30, 1929 (Fri-Sat): Backlog catch up and relieve personnel
  • Early Close 12:30pm on Mar 11, 1930 (Tue): Former President William Howard Taft funeral
  • Closed on Apr 19, 1930 (Sat): Saturday after Good Friday
  • Closed on May 31, 1930 (Sat): Saturday after Decoration Dday
  • Closed on Jul 5, 1930 (Sat): Saturday after Independence Day
  • Closed on Aug 30, 1930 (Sat): Saturday before Labor Day
  • Closed on Sep 5, 1931 (Sat): Saturday before Labor Day
  • Closed on Dec 26, 1931 (Sat): Saturday after Christmas
  • Closed on Jul 2, 1932 (Sat): Saturday before Independence Day
  • Closed on Jan 7, 1933 (Sat): Former President Calvin Coolidge funeral
  • Closed on Mar 4, 1933 (Sat): State banking holiday
  • Closed on Mar 6-14, 1933 (Mon-Tue): National banking holiday
  • Late Open 12pm on Jul 24-25, 1933 (Mon-Tue): Volume activity
  • Late Opens AND Early Closes on Jul 26-28, 1933 (Wed-Fri): Volume activity
  • Closed on July 29, 1933 (Sat): Volume activity
  • Early Close 12:30pm on Aug 4, 1933 (Fri): Gas fumes on trading floor
  • Closed on Aug 5, 1933 (Sat): Volume activity
  • Closed on Aug 12, 1933 (Sat): Volume activity
  • Closed on Aug 19, 1933 (Sat): Volume activity
  • Closed on Aug 26, 1933 (Sat): Volume activity
  • Closed on Sep 2, 1933 (Sat): Volume activity
  • Early Close 12pm on Sep 13, 1933 (Wed): NRA demonstration
  • Late Open 11am on Feb 20, 1934 (Tue): severe snowstorm
  • Late Open 11am on Jan 28, 1936 (Tue): King George V of England funeral
  • Closed on Dec 26, 1936 (Sat): Saturday after Christmas
  • Closed on May 29, 1937 (Sat): Saturday before Decoration Day
  • Closed on Jul 3, 1937 (Sat): Saturday before Independence Day
  • NOT IMPLEMENTED Break from 12-13:00 on May 18, 1942 (Mon): NYSE 150th anniversary
  • NOT IMPLEMENTED Break from 14:32-14:58 on Oct 22, 1942 (Thu): Civil Defense drill
  • NOT IMPLEMENTED Break from 14:38-14:59 on Oct 26, 1943 (Tue): Civil Defense drill
    • Reopened from 15:20-15:40 under special rule of the Board
  • Closed on Aug 19, 1944 (Sat)
  • Closed on Aug 26, 1944 (Sat)
  • Closed on Sep 2, 1944 (Sat)
  • Closed on Apr 14, 1945 (Sat): President Franklin D. Roosevelt National Day of mourning
  • NOT IMPLEMENTED Break 11:00-13:00 on Jun 19, 1945 (Tue): Parade for General Eisenhower
  • Closed on Saturdays Jul 7-Sep 1, 1945
  • Closed on Aug 15-16, 1945 (Wed-Thu): VJ Day. End of World War II
  • Closed on Oct 13, 1945 (Sat): Saturday after Columbus Day
  • Closed on Oct 27, 1945 (Sat): Navy Day
  • Closed on Dec 24, 1945 (Mon): Christmas Eve
  • Closed on Feb 23, 1946 (Sat): Saturday after Washington’s birthday
  • Closed on May 25, 1946 (Sat): Railroad strike
  • Closed on Saturdays Jun 1-Sep 28, 1946 (Sat-Sat)
  • Closed on Saturdays May 31-Sep 27, 1947 (Sat-Sat)
  • Closed on Jan 3, 1948 (Sat): severe weather
  • Closed on Saturdays May 29-Sep 25, 1948 (Sat-Sat)
  • Closed on Saturdays May 28-Sep 4, 1948 (Sat-Sat)
  • Cosed on Dec 24, 1949 (Sat): Christmas Eve
  • Closed on Saturdays Jun 3-Sep 30, 1950 (Sat-Sat)
  • Closed on Dec 12, 1950 (Sat): Saturday before Christmas Eve
  • NOT IMPLEMENTED Break from 11:00-13:00 on Apr 20, 1951 (Fri): Parade for General MacArthur
  • Closed on Saturdays Jun 2-Sep 29, 1951 (Sat-Sat)
  • NOT IMPLEMENTED Break from 10:33-11:05 (Wed): Civil Defense Drill
  • Early Close 1pm on Dec 24, 1951 (Mon): Christmas Eve
  • Closed on Saturdays May 31-Sep 27, 1952 (Sat-Sat)
    • As of Sep 29, 1952 Saturdays were retired as trading days
    • As of Sep 29, 1952, M-F trading closes at 3:30pm (30 minutes longer)
  • NOT IMPLEMENTED Break 10:02-10:32 on Jun 14, 1954 (Mon): Civil Defense drill
  • Closed on Dec 24, 1954 (Fri): Christmas Eve
  • NOT IMPLEMENTED Break 14:05-14:35 on Jun 15, 1955 (Wed): Civil Defense drill
  • Closed on Dec 24, 1956 (Mon): Christmas Eve
  • NOT IMPLEMENTED Break 13:45-14:15 on Jul 12, 1957 (Fri): Civil Defense drill
  • NOT IMPLEMENTED Break 10:30-10:50 on May 6, 1958 (Tue): Civil Defense drill
  • Closed on Dec 26, 1958 (Fri): Day after Christmas
  • NOT IMPLEMENTED Break 13:30-13:50 on Apr 17, 1959 (Fri): Civil Defense drill
  • NOT IMPLEMENTED Break 14:16-14:40 on May 3, 1960 (Tue): Civil Defense drill
  • Late Open 11:00 on Dec 12, 1960 (Mon): severe snowstorm
  • Closed on May 29, 1961 (Mon): Day before Decoration Day
  • Early Close 14:07 on Nov 22, 1963 (Fri): President John F. Kennedy assassintion
  • Closed on Nov 25, 1963 (Mon): President John F. Kennedy funeral
  • Early Close 14:00 on Oct 23, 1964 (Fri): Former President Herbert C. Hoover funeral
  • NOT IMPLEMENTED Break 11:00-11:02 on Jan 25, 1965 (Mon): Sir Winston Churchill 2 minutes of silence
  • Late Open 11:05 on Nov 10, 1965 (Wed): Power failure in NY grid supply
  • Closed on Dec 24, 1965 (Fri): Christmas Eve
  • Early Closes 14:00 on Jan 6-14, 1966 (Thu-Fri): Transit strike
  • NOT IMPLEMENTED Break 13:00-13:01 on Feb 3, 1967 (Fri): Apollo I disaster moment of silence
  • Late Open 10:15 AND Early Close 14:00 on Feb 7, 1967 (Tue): snowstorm
  • NOT IMPLEMENTED Break 12:58-13:13 on May 17, 1967 (Wed): Vice President Humphrey spoke in honor of NYSE’s 175th anniversary
  • Early Closes 14:00 on Aug 8-18, 1967 (Tue-Fri): Backlog catch up
  • Early Closes 14:00 on Jan 22-Mar 1, 1968 (Mon-Fri): Backlog catch up
  • Closed on Feb 12, 1968 (Mon): Lincoln’s birthday (offices open, trading closed)
  • NOT IMPLEMENTED Break 11:00-11:01 on Apr 5, 1968 (Fri): Dr. Martin Luther King, Jr. moment of silence
  • Closed on Apr 9, 1968 (Tue): Martin Luther King, Jr. day or mourning
  • NOT IMPLEMENTED Break 11:00-11:02 on Jun 6, 1968 (Fri): Senator Robert F. Kennedy moment of silence
  • 4 day workweek Closed on a Wednesday OR Holiday from Jun 12-Dec 31, 1968: Paperwork crisis
  • Closed on July 5, 1968 (Fri): Day after Independence Day
  • Early Closes 14:00 on Jan 2-Jul 3, 1969: Paperwork Crisis
  • Closed on Feb 10, 1969 (Mon): heavy snow
  • Late open 11am on Feb 11, 1969 (Tue): heavy snow
  • NOT IMPLEMENTED Break 13:30-13:32 on Mar 28, 1969 (Fri): Former President Dwight D. Eisenhower moment of silence
  • Closed on Mar 31, 1969 (Mon): Former President Dwight D. Eisenhower funeral
  • Late Open 10:45 on Jun 2, 1969 (Mon): storm
  • Early Closes 14:30 on Jul 7-Sep 26,1969 (Mon-Fri): Paperwork Crisis
  • Closed on Jul 21, 1969 (Mon): National Day of Participation for lunar exploration
  • NOT IMPLEMENTED Break 12:35-13:05 on Sep 3, 1969 (Wed): power failure
  • Early Closes 15:00 on Sep 29, 1969 to May 1, 1970: Paperwork Crisis
  • Closed on Dec 28, 1972 (Thu): Former President Harry S. Truman funeral
  • Closed on Jan 25, 1973 (Thu): Former President Lyndon B. Johnson funeral
  • Late Open 11am on Dec 17, 1973 (Mon): ice storm
  • Late Open 10:15 on Jan 16, 1974 (Wed): Merrill Lynch computer trouble
  • NOT IMPLEMENTED Break 11:09-11:35 on Apr 10, 1974 (Wed): computer malfunction
  • NOT IMPLEMENTED Break 11:46-12:22 on Oct 15, 1974 (Wed): Ticker down at 11:37 to 12:22
  • Late Open 10:15 on Nov 22, 1974 (Fri): Fire drill
  • Early Close 14:00 on Dec 24, 1974 (Tue): Christmas Eve
  • NOT IMPLEMENTED Break 10:07-10:50 on Jan 7, 1975 (Tue): Computer stopped
  • NOT IMPLEMENTED Break 13:24-13:45 on Jan 15, 1975 (Wed): Computer stopped
  • NOT IMPLEMENTED Break 10:24-11:00 on Feb 7, 1975 (Fri): Computer failure
  • Early Close 14:30 on Feb 12, 1975 (Wed): snowstorm
  • NOT IMPLEMENTED Break 10:09-10:35 on Apr 9, 1975 (Wed): Computer stopped
  • Early Close 14:00 on Dec 24, 1975 (Wed): Christmas Eve
  • Late Open 11:15 on Feb 2, 1976 (Mon): storm
  • Late Open UNKNOWN (coded as 10:15) on Jun 8, 1976 (Tue): fire drill
  • Early Close 15:00 on Aug 9, 1976 (Mon): hurricane watch
  • NOT IMPLEMENTED Break 1 minute time UNKNOWN on Nov 4, 1976 (Thu): Former NYSE Chair Gustave L. Levy moment of silence
  • NOT IMPLEMENTED Break 11:00-11:01 on Feb 24, 1977 (Thu): Former NYSE Chair John A. Coleman moment of silence
  • NOT IMPLEMENTED Break 10:24-11:45 on Mar 1, 1977 (Tue): Fire on moving ramp between trading floor and Blue Room
  • Closed on July 14, 1977 (Thu): Power failure in NYC
  • Late Open 12pm on Jan 20, 1978 (Fri): snowstorm
  • Early Close 2pm on Feb 6, 1978 (Mon): snowstorm
  • Late Open 11am on Feb 7, 1978 (Tue): snowstorm
  • NOT IMPLEMENTED Break 1 minute time UNKNOWN on Dec 13, 1979 (Thu): Former NYSE Chair Robert L. Stott minute of silence
  • NOT IMPLEMENTED Break 11:11-12:04 on Oct 13, 1980 (Mon): Computer malfunction
  • NOT IMPLEMENTED Break 1 minute time UNKNOWN on Dec 30, 1980 (Tue): Former NYSE Chair James Crane Kellogg III moment of silence
  • Early Close 3:17pm on Mar 30, 1981 (Mon): President Reagan assassination attempt
  • Early Close 3:28pm on Sep 9, 1981 (Wed): Con Edison power failure
  • NOT IMPLEMENTED Break 12:26-12:45pm on Sep 16, 1981 (Wed): Fire alarm malfunction
  • NOT IMPLEMENTED Break 10:25-11:00am on Dec 28, 1982 (Tue): small fire
  • NOT IMPLEMENTED Break 13:51-15:30 on Oct 13, 1983 (Thu): low speed ticker malfunction
  • Closed on Sep 27, 1985 (Fri): Hurricane Gloria
  • NOT IMPLEMENTED Break 11:00-11:01 on Jan 29, 1986 (Wed): Challenger space crew moment of silence
  • Early Closes 2pm on Oct 23-30, 1987 (Fri-Fri): October 19th break volume
  • Early Closes 2:30pm on Nov 2-4, 1987 (Mon-Wed): reason not given volume assumed
  • Early Closes 3pm on Nov 5-6, 1987 (Thu-Fri): reason not given volume assumed
  • Early Closes 3:30pm on Nov 9-11, 1987 (Mon-Wed): Trading floor and clerical staff strike
  • Late Open 11am on Nov 10, 1989 (Fri): Electrical fire
  • NOT IMPLEMENTED Break 9:41-11:15 on Nov 23, 1990 (Fri): Internal power failure
  • Early Close 2pm on Dec 24, 1990 (Mon): Christmas Eve
  • Late Open 11am on Dec 27, 1990 (Thu): explosion of Con Edison transformer
  • Late Open 9:31am on Jan 17, 1991 (Thu): American troops in Persian Gulf moment of silence
  • Late Open 9:31am on Feb 25, 1991 (Thu): American troops in Persian Gulf moment of silence
  • NOT IMPLEMENTED Break 10:21-10:45am on Oct 22, 1991 (Tue): power dip
  • Early Close 2pm on Dec 24, 1991 (Tue): Christmas Eve
  • NOT IMPLEMENTED Break 1 minute time UNKNOWN on Mar 19, 1992 (Thu): Former NYSE Chair Bernard J. Lasker moment of silence
  • NOT IMPLEMENTED Break 1 minute time UNKNOWN on May 15, 1992 (Fri): Former NYSE President G. Keith Funston moment of silence
  • NOT IMPELMENTED Break 1 minute time UNKNOWN on Jun 15, 1992 (Mon): Former NYSE President Robert W. Haack moment of silence
  • Early Close 2pm on Nov 27, 1992 (Fri): Day after Thanksgiving
  • Early Close 2pm on Dec 24, 1992 (Thu): Christmas Eve
  • Early Close 1pm on Nov 26, 1993 (Fri): Day after Thanksgiving
  • Early Close 14:30 on Feb 11, 1994 (Fri): snowstorm
  • NOT IMPLEMENTED Break 12:00-12:02 on Apr 25, 1994 (Mon): Former President Richard M. Nixon moment of silence
  • Closed on Apr 27, 1994 (Wed): Former President Richard M. Nixon funderal
  • Early Close 1pm on Nov 25, 1994 (Fri): Day after Thanksgiving
  • NOT IMPLEMENTED Break 10:02-10:03 on Apr 26, 1995 (Wed): Oklahoma City bombing victims moment of silence
  • Early Close 1pm on Jul 3, 1995 (Mon): Day before Independence Day
  • Early Close 1pm on Nov 24, 1995 (Fri): Day after Thanksgiving
  • Late Open 10:30am on Dec 18, 1995 (Mon): Computer system troubles
  • Late Open 11am AND Early Close 2pm on Jan 8, 1996 (Mon): snowstorm
  • NOT IMPLEMENTED Break time UNKNOWN on Apr 4, 1996 (Thu): Commerce Secretary Ron Brown and others killed in Balkans plane crash
  • Early Close 1pm on July 5, 1996 (Fri): Day after Independence Day
  • Early Close 1pm on Nov 29, 1996 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 1996 (Tue): Christmas Eve
  • Early Close 1pm on Jul 3, 1997 (Thu): Day before Independence Day
  • NOT IMPLEMENTED Break 14:35-15:05 on Oct 27, 1997 (Mon): Circuit breaker triggered
  • Early Close 3:30pm on Oct 27, 1997 (Mon): Circuit breaker triggered
  • Early Close 1pm on Nov 28, 1997 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 1997 (Wed): Christmas Eve
  • Early Close 1pm on Dec 26, 1997 (Fri): Friday after Christmas
  • NOT IMPLEMENTED Break time UNKNOWN on Jul 29, 1998 (Wed): Former NYSE President William McChesney Marting, Jr. moment of silence
  • NOT IMPLEMENTED Break 13:16-14:15 on Oct 26, 1998 (Mon): Computer switch malfunction
  • Early Close 1pm on Nov 27, 1998 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 1998 (Thu): Christmas Eve
  • NOT IMPLEMENTED Break 10:00-10:02 on Mar 25, 1999 (Thu): NATO troops in Kosovo minute of silence
  • NOT IMPLEMENTED Break 12:00-12:02 on Apr 26, 1999 (Mon): Columbine High School killings moment of silence
  • Early Close 1pm on Nov 26, 1999 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 1999 (Fri): Christmas Eve
  • NOT IMPLEMENTED Break 12:00-12:01 on Feb 16, 2000 (Wed): Former NYSE Chair Walter N. Frank moment of silence
  • NOT IMPLEMENTED Break 12:00-12:01 on May 4, 2000 (Thu): Archbishop of NY Cardinal John O’Connor moment of silence
  • Early Close 1pm on Jul 3, 2000 (Mon): Day before Independence Day
  • Early Close 1pm on Nov 24, 2000 (Fri): Day after Thanksgiving
  • NOT IMPLEMENTED Break 10:10-11:35 on Jun 8, 2001 (Fri): computer systems connectivity problem
  • Early Close 1pm on Jul 3, 2001 (Tue): Day before Independence Day
  • Closed on Sep 11-14, 2001 (Tue-Fri): Terrorist attack on World Trade Center
  • Late Open 9:33am on Sep 17, 2001 (Mon): 2 minutes silence in honor of lives lost on 9/11
  • Late Open 9:31am on Oct 8, 2001 (Mon): 1 minute silence for troops engaged in Operation Enduring Freedom
  • Early Close 1pm on Nov 23, 2001 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 2001 (Mon): Christmas Eve
  • NOT IMPLEMENTED Break 10:29-10:31 on May 30, 2002 (Thu): Commemorate end of recovery work at Ground Zero
  • Early Close 1pm on Jul 5, 2002 (Fri): Day after Independence Day
  • Late Opening 12:00pm on Sep 11, 2002 (Wed): 1 year anniversary of 9/11 attack
  • Early Close 1pm on Nov 29, 2002 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 2002 (Tue): Christmas Eve
  • NOT IMPLEMENTED Break 11:00-11:02 on Feb 3, 2002 (Mon): Columbia Space Shuttle lives lost moment of silence
  • Late Opening 9:32am on Mar 20, 2003 (Thu): Operation Iraqi Freedom Troops moment of silence
  • Early Close 1pm on Jul 3, 2003 (Thu): Day before Independence Day
  • NOT IMPLEMENTED multiple 1-minute Breaks 9:59 and 10:29 on Sep 11, 2003 (Thu): 9/11 Commemoration
  • Early Close 1pm on Nov 28, 2003 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 2003 (Wed): Christmas Eve
  • Early Close 1pm on Dec 26, 2003 (Fri): Friday after Christmas
  • Late Open 9:32am on Jun 7, 2004 (Mon): Former President Ronald Reagan death moment of silence
  • Closed on Jun 11, 2004 (Fri): Former President Ronald Reagan National Day of Mourning
  • Early Close 1pm on Nov 26, 2004 (Fri): Day after Thanksgiving
  • Early Close 3:56pm on Jun 1, 2005 (Wed): Systems communication problem
  • Early Close 1pm on Nov 25, 2005 (Fri): Day after Thanksgiving
  • Early Close 1pm on Jul 3, 2006 (Mon): Day before Independence Day
  • Early Close 1pm on Nov 24, 2006 (Fri): Day after Thanksgiving
  • Late Open 9:32am on Dec 27, 2006 (Wed): Former President Gerald Ford moment of silence
  • Closed on Jan 2, 2007 (Tue): Former President Gerald Ford National Day of Mourning
  • Early Close 1pm on Jul 3, 2007 (Tue): Day before Independence Day
  • Early Close 1pm on Nov 23, 2007 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 2007 (Mon): Christmas Eve
  • Early Close 1pm on Jul 4, 2008 (Thu): Day before Independence Day
  • Early Close 1pm on Nov 28, 2008 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 2008 (Wed): Christmas Eve
  • NOT IMPLEMENTED Extended Close 4:15pm on Jul 2, 2009 (Thu): Execute customer orders impacted by system irregularities
  • Early Close 1pm on Nov 27, 2009 (Fri): Day after Thanksgiving
  • Early Close 1pm on Dec 24, 2009 (Thu): Christmas Eve
  • Early Close 1pm on Nov 26, 2010 (Fri): Day after Thanksgiving
  • NOT IMPLEMENTED Break 11:00-11:01 on Jan 10, 2011 (Mon): Arizona shooting victims moment of silence

https://www.streetinsider.com/Insiders+Blog/NYSE+Releases+2010+and+2011+Holiday+Calendar/4915576.html - Early Close 1pm on Nov 25, 2011 (Fri): Day after Thanksgiving

https://holidaystracker.com/stock-market/new-york-stock-exchange-holidays-2012/ - Early Close 1pm on Jul 4, 2012 (Tue): Day before Independence Day - Closed on 10/29/2012 and 10/30/2012 due to Hurricane Sandy. - Early Close 1pm on Nov 23, 2012 (Fri): Day after Thanksgiving - Early Close 1pm on Dec 24, 2012 (Mon): Christmas Eve

https://holidaystracker.com/stock-market/new-york-stock-exchange-nyse-holidays-2013/ - Early Close 1pm on Jul 3, 2013 (Wed): Day before Independence Day - Early Close 1pm on Nov 29, 2013 (Fri): Day after Thanksgiving - Early Close 1pm on Dec 24, 2013 (Tue): Christmas Eve

https://www.streetinsider.com/Insiders+Blog/NYSE+2014+and+2015+Holiday+Hours/8999575.html - Early Close 1pm on Jul 3, 2014 (Thu): Day before Independence Day - Early Close 1pm on Jul 3, 2014 (Thu): Day before Independence Day - Early Close 1pm on Nov 28, 2014 (Fri): Day after Thanksgiving - Early Close 1pm on Dec 24, 2014 (Wed): Christmas Eve

https://www.businesswire.com/news/home/20141208006349/en/NYSE-Group-2016-Holiday-Calendar-and-Early-Closings - Early Close 1pm on Nov 27, 2015 (Fri): Day after Thanksgiving - Early Close 1pm on Dec 24, 2015 (Thu): Christmas Eve - Early Close 1pm on Nov 25, 2016 (Fri): Day after Thanksgiving

https://www.stockinvestor.com/30380/stock-market-holidays-2017/ - Early Close 1pm on Jul 3, 2017 (Mon): Day before Independence Day - Early Close 1pm on Nov 24, 2017 (Fri): Day after Thanksgiving - Early Close 1pm on Jul 3, 2018 (Tue): Day before Independence Day - Early Close 1pm on Nov 23, 2018 (Fri): Day after Thanksgiving - Closed on 12/5/2018 due to George H.W. Bush’s death. - Early Close 1pm on Dec 24, 2018 (Tue): Christmas Eve - Early Close 1pm on Jul 3, 2019 (Wed): Day before Independence Day - Early Close 1pm on Nov 29, 2019 (Fri): Day after Thanksgiving - Early Close 1pm on Dec 24, 2019 (Wed): Christmas Eve

https://holidaystracker.com/stock-market/new-york-stock-exchange-nyse-holidays-2020/ - Early Close 1pm on Nov 27, 2020 (Fri): Day after Thanksgiving - Early Close 1pm on Dec 24, 2020 (Thu): Christmas Eve

NOTE: The exchange was not closed early on Friday December 26, 2008, nor was it closed on Friday December 26, 2014. The next Thursday Christmas will be in 2025. If someone is still maintaining this code in 2025, then we’ve done alright…and we should check if it’s a half day.

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['NYSE', 'stock', 'NASDAQ', 'BATS', 'DJIA', 'DOW']
days_at_time(days, market_time, day_offset=0)

Create an index of days at time t, interpreted in timezone tz. The returned index is localized to UTC.

In the example below, the times switch from 13:45 to 12:45 UTC because March 13th is the daylight savings transition for US/Eastern. All the times are still 8:45 when interpreted in US/Eastern.

>>> import pandas as pd; import datetime; import pprint
>>> dts = pd.date_range('2016-03-12', '2016-03-14')
>>> dts_at_845 = days_at_time(dts, datetime.time(8, 45), 'US/Eastern')
>>> pprint.pprint([str(dt) for dt in dts_at_845])
['2016-03-12 13:45:00+00:00',
 '2016-03-13 12:45:00+00:00',
 '2016-03-14 12:45:00+00:00']
Parameters:
  • days – DatetimeIndex An index of dates (represented as midnight).
  • market_time – datetime.time The time to apply as an offset to each day in days.
  • day_offset – int The number of days we want to offset @days by
Returns:

DatetimeIndex of date with the time t

early_closes(schedule)

Get a DataFrame of the dates that are an early close.

Parameters:schedule – schedule DataFrame
Returns:schedule DataFrame with rows that are early closes
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(15, 0)), ('1952-09-29', datetime.time(15, 30)), ('1974-01-01', datetime.time(16, 0))), 'market_open': ((None, datetime.time(10, 0)), ('1985-01-01', datetime.time(9, 30))), 'post': ((None, datetime.time(20, 0)),), 'pre': ((None, datetime.time(4, 0)),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_closes_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
special_opens

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_opens_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
valid_days(start_date, end_date, tz='UTC')

Get a DatetimeIndex of valid open business days.

Parameters:
  • start_date – start date
  • end_date – end date
  • tz – time zone in either string or pytz.timezone
Returns:

DatetimeIndex of valid business days

weekmask

pandas_market_calendars.exchange_calendar_ose module

class pandas_market_calendars.exchange_calendar_ose.OSEExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for Oslo Stock Exchange

Note these dates are only checked against 2017, 2018 and 2019 https://www.oslobors.no/ob_eng/Oslo-Boers/About-Oslo-Boers/Opening-hours

Opening times for the regular trading of equities (not including closing auction call) Open Time: 9:00 AM, CEST/EST Close Time: 4:20 PM, CEST/EST

Regularly-Observed Holidays (not necessarily in order): - New Years Day - Wednesday before Easter (Half trading day) - Maundy Thursday - Good Friday - Easter Monday - Labour Day - Ascension Day - Constitution Day - Whit Monday - Christmas Eve - Christmas Day - Boxing Day - New Year’s Eve

aliases = ['OSE']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(16, 20)),), 'market_open': ((None, datetime.time(9, 0)),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_six module

class pandas_market_calendars.exchange_calendar_six.SIXExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for SIX

aliases = ['SIX']
name

Name of the market

Returns:string name
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(17, 30)),), 'market_open': ((None, datetime.time(9, 0)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_sse module

class pandas_market_calendars.exchange_calendar_sse.SSEExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for Shanghai Stock Exchange

Open Time: 9:30 AM, Asia/Shanghai LUNCH BREAK :facepalm: : 11:30 AM - 1:00 PM Asia/Shanghai Close Time: 3:00 PM, Asia/Shanghai

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['SSE']
name

Name of the market

Returns:string name
regular_holidays

Rules are guesses based on observations of recent year. Rectify accordingly once the next year’s holidays arrangement is published by the government.

regular_market_times = {'break_end': ((None, datetime.time(13, 0)),), 'break_start': ((None, datetime.time(11, 30)),), 'market_close': ((None, datetime.time(15, 0)),), 'market_open': ((None, datetime.time(9, 30)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
pandas_market_calendars.exchange_calendar_sse.lunisolar(dt, mapping, func=None, delta=None)
pandas_market_calendars.exchange_calendar_sse.second_day_in_lieu(dt)
pandas_market_calendars.exchange_calendar_sse.third_day_in_lieu(dt)

pandas_market_calendars.exchange_calendar_tase module

class pandas_market_calendars.exchange_calendar_tase.TASEExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for TASE Stock Exchange

Note these dates are only checked against 2020 and 2021 https://info.tase.co.il/Eng/about_tase/corporate/Pages/vacation_schedule.aspx

Opening times for the regular trading of equities (not including closing auction call) Open Time: 10:00 AM Asia/Jerusalem Close Time: 3:59 PM Asia/Jerusalem

Daylight Saving Time in Israel comes into effect on the Friday before the last Sunday in March, and lasts until the last Sunday in October. During the Daylight Saving time period the clock will be UTC+3, and for the rest of the year UTC+2.

Regularly-Observed Holidays (not necessarily in order): - Purim - Passover_I_Eve - Passover_I - Passover_II_Eve - Passover_II - Independence_Day - Yom_HaZikaron - Shavuot_Eve - Shavuot - Tisha_beAv - Jewish_New_Year_Eve - Jewish_New_Year_I - Jewish_New_Year_II - Yom_Kippur_Eve - Yom_Kippur - Sukkoth_Eve - Sukkoth - Simchat_Tora_Eve - Simchat_Tora

adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['TASE']
name

Name of the market

Returns:string name
regular_market_times = {'market_close': ((None, datetime.time(15, 59)),), 'market_open': ((None, datetime.time(10, 0)),)}
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
weekmask

pandas_market_calendars.exchange_calendar_tsx module

class pandas_market_calendars.exchange_calendar_tsx.TSXExchangeCalendar(open_time=None, close_time=None)

Bases: pandas_market_calendars.market_calendar.MarketCalendar

Exchange calendar for the Toronto Stock Exchange

Open Time: 9:30 AM, EST Close Time: 4:00 PM, EST

Regularly-Observed Holidays: - New Years Day (observed on first business day on/after) - Family Day (Third Monday in February, starting in 2008) - Good Friday - Victoria Day (Monday before May 25th) - Canada Day (July 1st, observed first business day after) - Civic Holiday (First Monday in August) - Labor Day (First Monday in September) - Thanksgiving (Second Monday in October) - Christmas Day

  • Dec. 26th if Christmas is on a Sunday
  • Dec. 27th if Christmas is on a weekend
  • Boxing Day
    • Dec. 27th if Christmas is on a Sunday
    • Dec. 28th if Boxing Day is on a weekend

Early closes: - Starting in 2010, if Christmas Eve falls on a weekday, the market

closes at 1:00 pm that day. If it falls on a weekend, there is no early close.
adhoc_holidays
Returns:list of ad-hoc holidays
aliases = ['TSX', 'TSXV']
name

Name of the market

Returns:string name
regular_early_close = datetime.time(13, 0)
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(16, 0)),), 'market_open': ((None, datetime.time(9, 30)),)}
special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone

pandas_market_calendars.exchange_calendar_xbom module

pandas_market_calendars.holidays_cn module

pandas_market_calendars.holidays_jp module

pandas_market_calendars.holidays_oz module

pandas_market_calendars.holidays_uk module

pandas_market_calendars.holidays_us module

pandas_market_calendars.holidays_us.following_tuesday_every_four_years_observance(dt)
pandas_market_calendars.holidays_us.july_5th_holiday_observance(datetime_index)

pandas_market_calendars.jpx_equinox module

Equinox Day is a public holiday in Japan that usually occurs:
(in the Spring) on March 20 or 21, (in the Autumn) on September 22 or 23,

the date of the equinox in Japan Standard Time. Due to the necessity of recent astronomical measurements, the date of the holiday is not officially declared until February of the previous year

We can’t easily compute the equinox for a given year, so we pre-compute a list of those from the Tokyo exchange inauguration through 2099, using pyephem (http://rhodesmill.org/pyephem/quick.html#equinoxes-solstices). For a double check, see: https://aa.usno.navy.mil/data/docs/EarthSeasons.php

pandas_market_calendars.jpx_equinox.autumnal_citizen_dates(start=2003, end=2099)
pandas_market_calendars.jpx_equinox.autumnal_equinox(dt)
pandas_market_calendars.jpx_equinox.autumnal_equinox_for_year(year)
pandas_market_calendars.jpx_equinox.vernal_equinox(dt)
pandas_market_calendars.jpx_equinox.vernal_equinox_for_year(year)

pandas_market_calendars.market_calendar module

class pandas_market_calendars.market_calendar.MarketCalendar(open_time=None, close_time=None)

Bases: object

An MarketCalendar represents the timing information of a single market or exchange. Unless otherwise noted all times are in UTC and use Pandas data structures.

add_time(market_time, times)

Adds the specified market time to regular_market_times and makes the necessary adjustments.

Parameters:
  • market_time – the market_time to add
  • times – the time information
Returns:

None

adhoc_holidays
Returns:list of ad-hoc holidays
break_end

Break time end. If None then there is no break

Returns:time or None
break_end_on(date)
break_start

Break time start. If None then there is no break

Returns:time or None
break_start_on(date)
classmethod calendar_names()

All Market Calendar names and aliases that can be used in “factory” :return: list(str)

change_time(market_time, times)

Changes the specified market time in regular_market_times and makes the necessary adjustments.

Parameters:
  • market_time – the market_time to change
  • times – new time information
Returns:

None

clean_dates(start_date, end_date)

Strips the inputs of time and time zone information

Parameters:
  • start_date – start date
  • end_date – end date
Returns:

(start_date, end_date) with just date, no time and no time zone

close_offset
Returns:close offset
close_time

Default close time for the market

Returns:time
close_time_on(date)
days_at_time(days, market_time, day_offset=0)

Create an index of days at time t, interpreted in timezone tz. The returned index is localized to UTC.

In the example below, the times switch from 13:45 to 12:45 UTC because March 13th is the daylight savings transition for US/Eastern. All the times are still 8:45 when interpreted in US/Eastern.

>>> import pandas as pd; import datetime; import pprint
>>> dts = pd.date_range('2016-03-12', '2016-03-14')
>>> dts_at_845 = days_at_time(dts, datetime.time(8, 45), 'US/Eastern')
>>> pprint.pprint([str(dt) for dt in dts_at_845])
['2016-03-12 13:45:00+00:00',
 '2016-03-13 12:45:00+00:00',
 '2016-03-14 12:45:00+00:00']
Parameters:
  • days – DatetimeIndex An index of dates (represented as midnight).
  • market_time – datetime.time The time to apply as an offset to each day in days.
  • day_offset – int The number of days we want to offset @days by
Returns:

DatetimeIndex of date with the time t

early_closes(schedule)

Get a DataFrame of the dates that are an early close.

Parameters:schedule – schedule DataFrame
Returns:schedule DataFrame with rows that are early closes
classmethod factory(name, *args, **kwargs)
Parameters:
  • cls(RegisteryMeta) – registration meta class
  • name(str) – name of class that needs to be instantiated
  • args(Optional(tuple)) – instance positional arguments
  • kwargs(Optional(dict)) – instance named arguments
Returns:

class instance

get_offset(market_time)
get_special_times(market_time)
get_special_times_adhoc(market_time)
get_time(market_time, all_times=False)
get_time_on(market_time, date)
has_custom
has_discontinued
holidays()

Returns the complete CustomBusinessDay object of holidays that can be used in any Pandas function that take that input.

Returns:CustomBusinessDay object of holidays
is_custom(market_time)
is_different(col, diff=None)
is_discontinued(market_time)
is_open_now(schedule, include_close=False, only_rth=False)

To determine if the current local system time (converted to UTC) is an open time for the market

Parameters:
  • schedule – schedule DataFrame
  • include_close – if False then the function will return False if the current local system time is equal to the closing timestamp. If True then it will return True if the current local system time is equal to the closing timestamp. Use True if using bars and would like to include the last bar as a valid open date and time.
  • only_rth – whether to consider columns that are before market_open or after market_close
Returns:

True if the current local system time is a valid open date and time, False if not

late_opens(schedule)

Get a DataFrame of the dates that are an late opens.

Parameters:schedule – schedule DataFrame
Returns:schedule DataFrame with rows that are late opens
market_times
name

Name of the market

Returns:string name
open_at_time(schedule, timestamp, include_close=False, only_rth=False)

To determine if a given timestamp is during an open time for the market.

Parameters:
  • schedule – schedule DataFrame
  • timestamp – the timestamp to check for
  • include_close – if False then the timestamp that equals the closing timestamp will return False and not be considered a valid open date and time. If True then it will be considered valid and return True. Use True if using bars and would like to include the last bar as a valid open date and time. The close refers to the latest market_time available, which could be after market_close (e.g. ‘post’).
  • only_rth – whether to ignore columns that are before market_open or after market_close. If true, include_close will be referring to market_close.
Returns:

True if the timestamp is a valid open date and time, False if not

open_offset
Returns:open offset
open_time

Default open time for the market

Returns:time
open_time_on(date)
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(23, 0)),), 'market_open': ((None, datetime.time(0, 0)),)}
remove_time(market_time)

Removes the specified market time from regular_market_times and makes the necessary adjustments.

Parameters:market_time – the market_time to remove
Returns:None
schedule(start_date, end_date, tz='UTC', start='market_open', end='market_close', force_special_times=True, market_times=None)

Generates the schedule DataFrame. The resulting DataFrame will have all the valid business days as the index and columns for the requested market times. The columns can be determined either by setting a range (inclusive on both sides), using start and end, or by passing a list to `market_times’. A range of market_times is derived from a list of market_times that are available to the instance, which are sorted based on the current regular time. See the docs for examples.

All time zones are set to UTC by default. Setting the tz parameter will convert the columns to the desired timezone, such as ‘America/New_York’

Parameters:
  • start_date – first date of the schedule
  • end_date – last date of the schedule
  • tz – timezone that the columns of the returned schedule are in, default: “UTC”
  • start – the first market_time to include as a column, default: “market_open”
  • end – the last market_time to include as a column, default: “market_close”
  • force_special_times

    how to handle special times. True: overwrite regular times of the column itself, conform other columns to special times of

    market_open/market_close if those are requested.

    False: only overwrite regular times of the column itself, leave others alone None: completely ignore special times -> See examples/usage.ipynb for demonstrations

  • market_times – alternative to start/end, list of market_times that are in self.regular_market_times
Returns:

schedule DataFrame

special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_closes_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_dates(market_time, start_date, end_date, filter_holidays=True)

Calculate a datetimeindex that only contains the specail times of the requested market time.

Parameters:
  • market_time – market_time reference
  • start_date – first possible date of the index
  • end_date – last possible date of the index
  • filter_holidays – will filter days by self.valid_days, which can be useful when debugging
Returns:

schedule DatetimeIndex

special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
special_opens

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_opens_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
valid_days(start_date, end_date, tz='UTC')

Get a DatetimeIndex of valid open business days.

Parameters:
  • start_date – start date
  • end_date – end date
  • tz – time zone in either string or pytz.timezone
Returns:

DatetimeIndex of valid business days

weekmask
class pandas_market_calendars.market_calendar.MarketCalendarMeta(name, bases, attr)

Bases: abc.ABCMeta, pandas_market_calendars.class_registry.RegisteryMeta

pandas_market_calendars.trading_calendars_mirror module

Module contents

class pandas_market_calendars.MarketCalendar(open_time=None, close_time=None)

Bases: object

An MarketCalendar represents the timing information of a single market or exchange. Unless otherwise noted all times are in UTC and use Pandas data structures.

add_time(market_time, times)

Adds the specified market time to regular_market_times and makes the necessary adjustments.

Parameters:
  • market_time – the market_time to add
  • times – the time information
Returns:

None

adhoc_holidays
Returns:list of ad-hoc holidays
break_end

Break time end. If None then there is no break

Returns:time or None
break_end_on(date)
break_start

Break time start. If None then there is no break

Returns:time or None
break_start_on(date)
classmethod calendar_names()

All Market Calendar names and aliases that can be used in “factory” :return: list(str)

change_time(market_time, times)

Changes the specified market time in regular_market_times and makes the necessary adjustments.

Parameters:
  • market_time – the market_time to change
  • times – new time information
Returns:

None

clean_dates(start_date, end_date)

Strips the inputs of time and time zone information

Parameters:
  • start_date – start date
  • end_date – end date
Returns:

(start_date, end_date) with just date, no time and no time zone

close_offset
Returns:close offset
close_time

Default close time for the market

Returns:time
close_time_on(date)
days_at_time(days, market_time, day_offset=0)

Create an index of days at time t, interpreted in timezone tz. The returned index is localized to UTC.

In the example below, the times switch from 13:45 to 12:45 UTC because March 13th is the daylight savings transition for US/Eastern. All the times are still 8:45 when interpreted in US/Eastern.

>>> import pandas as pd; import datetime; import pprint
>>> dts = pd.date_range('2016-03-12', '2016-03-14')
>>> dts_at_845 = days_at_time(dts, datetime.time(8, 45), 'US/Eastern')
>>> pprint.pprint([str(dt) for dt in dts_at_845])
['2016-03-12 13:45:00+00:00',
 '2016-03-13 12:45:00+00:00',
 '2016-03-14 12:45:00+00:00']
Parameters:
  • days – DatetimeIndex An index of dates (represented as midnight).
  • market_time – datetime.time The time to apply as an offset to each day in days.
  • day_offset – int The number of days we want to offset @days by
Returns:

DatetimeIndex of date with the time t

early_closes(schedule)

Get a DataFrame of the dates that are an early close.

Parameters:schedule – schedule DataFrame
Returns:schedule DataFrame with rows that are early closes
classmethod factory(name, *args, **kwargs)
Parameters:
  • cls(RegisteryMeta) – registration meta class
  • name(str) – name of class that needs to be instantiated
  • args(Optional(tuple)) – instance positional arguments
  • kwargs(Optional(dict)) – instance named arguments
Returns:

class instance

get_offset(market_time)
get_special_times(market_time)
get_special_times_adhoc(market_time)
get_time(market_time, all_times=False)
get_time_on(market_time, date)
has_custom
has_discontinued
holidays()

Returns the complete CustomBusinessDay object of holidays that can be used in any Pandas function that take that input.

Returns:CustomBusinessDay object of holidays
is_custom(market_time)
is_different(col, diff=None)
is_discontinued(market_time)
is_open_now(schedule, include_close=False, only_rth=False)

To determine if the current local system time (converted to UTC) is an open time for the market

Parameters:
  • schedule – schedule DataFrame
  • include_close – if False then the function will return False if the current local system time is equal to the closing timestamp. If True then it will return True if the current local system time is equal to the closing timestamp. Use True if using bars and would like to include the last bar as a valid open date and time.
  • only_rth – whether to consider columns that are before market_open or after market_close
Returns:

True if the current local system time is a valid open date and time, False if not

late_opens(schedule)

Get a DataFrame of the dates that are an late opens.

Parameters:schedule – schedule DataFrame
Returns:schedule DataFrame with rows that are late opens
market_times
name

Name of the market

Returns:string name
open_at_time(schedule, timestamp, include_close=False, only_rth=False)

To determine if a given timestamp is during an open time for the market.

Parameters:
  • schedule – schedule DataFrame
  • timestamp – the timestamp to check for
  • include_close – if False then the timestamp that equals the closing timestamp will return False and not be considered a valid open date and time. If True then it will be considered valid and return True. Use True if using bars and would like to include the last bar as a valid open date and time. The close refers to the latest market_time available, which could be after market_close (e.g. ‘post’).
  • only_rth – whether to ignore columns that are before market_open or after market_close. If true, include_close will be referring to market_close.
Returns:

True if the timestamp is a valid open date and time, False if not

open_offset
Returns:open offset
open_time

Default open time for the market

Returns:time
open_time_on(date)
regular_holidays
Returns:pd.AbstractHolidayCalendar: a calendar containing the regular holidays for this calendar
regular_market_times = {'market_close': ((None, datetime.time(23, 0)),), 'market_open': ((None, datetime.time(0, 0)),)}
remove_time(market_time)

Removes the specified market time from regular_market_times and makes the necessary adjustments.

Parameters:market_time – the market_time to remove
Returns:None
schedule(start_date, end_date, tz='UTC', start='market_open', end='market_close', force_special_times=True, market_times=None)

Generates the schedule DataFrame. The resulting DataFrame will have all the valid business days as the index and columns for the requested market times. The columns can be determined either by setting a range (inclusive on both sides), using start and end, or by passing a list to `market_times’. A range of market_times is derived from a list of market_times that are available to the instance, which are sorted based on the current regular time. See the docs for examples.

All time zones are set to UTC by default. Setting the tz parameter will convert the columns to the desired timezone, such as ‘America/New_York’

Parameters:
  • start_date – first date of the schedule
  • end_date – last date of the schedule
  • tz – timezone that the columns of the returned schedule are in, default: “UTC”
  • start – the first market_time to include as a column, default: “market_open”
  • end – the last market_time to include as a column, default: “market_close”
  • force_special_times

    how to handle special times. True: overwrite regular times of the column itself, conform other columns to special times of

    market_open/market_close if those are requested.

    False: only overwrite regular times of the column itself, leave others alone None: completely ignore special times -> See examples/usage.ipynb for demonstrations

  • market_times – alternative to start/end, list of market_times that are in self.regular_market_times
Returns:

schedule DataFrame

special_closes

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_closes_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_dates(market_time, start_date, end_date, filter_holidays=True)

Calculate a datetimeindex that only contains the specail times of the requested market time.

Parameters:
  • market_time – market_time reference
  • start_date – first possible date of the index
  • end_date – last possible date of the index
  • filter_holidays – will filter days by self.valid_days, which can be useful when debugging
Returns:

schedule DatetimeIndex

special_market_close

A list of special close times and corresponding HolidayCalendars.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_close_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special closes that cannot be codified into rules.
special_market_open

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_market_open_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
special_opens

A list of special open times and corresponding AbstractHolidayCalendar.

Returns:List of (time, AbstractHolidayCalendar) tuples
special_opens_adhoc
Returns:List of (time, DatetimeIndex) tuples that represent special opens that cannot be codified into rules.
tz

Time zone for the market.

Returns:timezone
valid_days(start_date, end_date, tz='UTC')

Get a DatetimeIndex of valid open business days.

Parameters:
  • start_date – start date
  • end_date – end date
  • tz – time zone in either string or pytz.timezone
Returns:

DatetimeIndex of valid business days

weekmask
pandas_market_calendars.get_calendar(name, open_time=None, close_time=None)

Retrieves an instance of an MarketCalendar whose name is given.

Parameters:
  • name – The name of the MarketCalendar to be retrieved.
  • open_time – Market open time override as datetime.time object. If None then default is used.
  • close_time – Market close time override as datetime.time object. If None then default is used.
Returns:

MarketCalendar of the desired calendar.

pandas_market_calendars.get_calendar_names()

All Market Calendar names and aliases that can be used in “factory” :return: list(str)

pandas_market_calendars.merge_schedules(schedules, how='outer')

Given a list of schedules will return a merged schedule. The merge method (how) will either return the superset of any datetime when any schedule is open (outer) or only the datetime where all markets are open (inner)

CAVEATS:
  • This does not work for schedules with breaks, the break information will be lost.
  • Onlu “market_open” and “market_close” are considered, other market times are not yet supported.
Parameters:
  • schedules – list of schedules
  • how – outer or inner
Returns:

schedule DataFrame

pandas_market_calendars.convert_freq(index, frequency)

Converts a DateTimeIndex to a new lower frequency

Parameters:
  • index – DateTimeIndex
  • frequency – frequency string
Returns:

DateTimeIndex