holidays

Holidays and nontrading days

Syntax

H = holidays
H = holidays(StartDate, EndDate)
H = holidays(StartDate, EndDate, AltHolidays)

Description

H = holidays returns a vector of serial date numbers corresponding to all holidays and nontrading days.

H = holidays(StartDate, EndDate) returns a vector of serial date numbers corresponding to the holidays and nontrading days between StartDate and EndDate, inclusive.

H = holidays(StartDate, EndDate, AltHolidays) returns a vector of serial date numbers corresponding to the alternate list of holidays and nontrading days.

Input Arguments

StartDate

Start date. Enter as a serial date number or date string.

EndDate

End date. Enter as a serial date number or date string.

AltHolidays

Alternate list of holidays and nontrading days stored as serial date numbers.

Output Arguments

H

Returns a vector of serial date numbers corresponding to all holidays and nontrading days.

Definitions

holidays is based on a modern 5-day workweek. This function contains all holidays and special nontrading days for the New York Stock Exchange from January 1, 1885 to December 31, 2050. Since the New York Stock Exchange was open on Saturdays before September 29, 1952, exact closures from 1885 to 2050 should include Saturday trading days. To capture these dates, use the function nyseclosures. The results from holidays and nyseclosures are identical if the WorkWeekFormat in nyseclosures is 'Modern'.

Examples

Create a vector of serial date numbers corresponding to all holidays and nontrading dates between a specified StartDate and EndDate:

H = holidays('jan 1 2001', 'jun 23 2001') 

This returns:

H =

      730852
      730866
      730901
      730954
      730999

The serial date numbers for these values are:

01-Jan-2001 (New Year's Day)
15-Jan-2001 (Martin Luther King Day)
19-Feb-2001 (President's Day)
13-Apr-2001 (Good Friday)
28-May-2001 (Memorial Day)
Was this topic helpful?