Calendar-related Commands in the Finance Package
Overview
Examples
Western-Style Calendars
See Also
The Financial Modeling package supports over 20 calendars which include New York, London, Tokyo and Toronto stock exchanges. In addition, the package provides tools for creating new calendars and manipulating already existing calendars. Here is the list of related commands.
AddHoliday
-
add a holiday to the given calendar
AdjustDate
adjust a non-business day according to the given convention
AdvanceDate
advance a non-business day according to the given convention
Calendar
create new business calendar
DayOfWeek
return the day of the week on which the given date falls
IsBusinessDay
check if a given date is a business day according to a given calendar
IsEndOfMonth
check if a given date corresponds to the end of a month according to a given calendar
JoinBusinessDays
create a new calendar obtained by joining business days of the given two calendars
JoinHolidays
create a new calendar obtained by joining holidays of the given two calendars
IsHoliday
check if a given date is a holiday according to a given calendar
Here are some examples.
restart;withFinance:
For example, to check whether the 3rd of September, 2007 is a holiday according to the New York Stock Exchange.
IsHoliday⁡Sep-03-2007,NewYork;
true
You can adjust this date using one of several supported business day conventions.
FinanceAdjustDate⁡Sep-03-2007,NewYork,convention=Following;
Sep-04-2007
FinanceAdjustDate⁡Sep-03-2007,NewYork,convention=Preceding;
Aug-31-2007
FinanceAdjustDate⁡Sep-03-2007,NewYork,convention=Unadjusted;
Sep-03-2007
Determine on what day of the week the 3rd of September, 2007 falls.
DayOfWeek⁡September 03, 2007;
Monday
In the next example you will create new calendar data structure and add holidays to this calendar.
C1≔Calendar;
C1:=moduleend module
IsHoliday⁡Aug-18-2006,C1;
false
Add two holidays to this calendar.
AddHoliday⁡C1, Aug-18-2006;
AddHoliday⁡C1,Aug-19-2006;
Now August 18, 2006 is a holiday in the new calendar.
Construct another calendar.
C2≔CalendarToronto;
C2:=moduleend module
Construct two new calendars based on the ones we already have: one obtained by joining holidays, and the other one obtained by joining business days from the two preceding calendars.
C3≔JoinHolidaysC1,C2;
C3:=moduleend module
C4≔JoinBusinessDaysC1,C2;
C4:=moduleend module
AdjustDate⁡August 18, 2006,C1,convention=Following;
August 20, 2006
AdjustDate⁡August 18, 2006,C2,convention=Following;
August 18, 2006
AdjustDate⁡August 18, 2006,C3,convention=Following;
August 21, 2006
AdjustDate⁡August 18, 2006,C4,convention=Following;
The calendars constructed earlier can now be passed to other routines from the package. These routines will perform date adjustments in accordance with the specified calendars.
SetEvaluationDate⁡July 10, 2006;
December 8, 2006
schedule1:=Schedule⁡July 18, 2006,September 18, 2006,Monthly,calendar=C1;
schedule1:=moduleend module
benchmark:=BenchmarkRate⁡1,Months,EURIBOR,0.05;
benchmark:=moduleend module
IRS1:=InterestRateSwap⁡100,benchmark,schedule1,0.05,schedule1,0.0;
IRS1:=moduleend module
CashFlows⁡IRS1,paying;
.466839741785402273 on 'August 20, 2006',.384298182901438634 on 'September 18, 2006'
schedule2:=Schedule⁡July 18, 2006,September 18, 2006,Monthly,calendar=C2;
schedule2:=moduleend module
IRS2:=InterestRateSwap⁡100,benchmark,schedule2,0.05,schedule2,0.;
IRS2:=moduleend module
CashFlows⁡IRS2,paying;
.453078103598340831 on 'August 18, 2006',.398050398536189787 on 'September 18, 2006'
schedule3:=Schedule⁡July 18, 2006,September 18, 2006,Monthly,calendar=C3;
schedule3:=moduleend module
IRS3:=InterestRateSwap⁡100,benchmark,schedule3,0.05,schedule3,0.;
IRS3:=moduleend module
CashFlows⁡IRS3,paying;
.466839741785402273 on 'August 21, 2006',.384298182901438634 on 'September 18, 2006'
Bratislava Stock Exchange
Holidays
Saturdays
Sundays
New Year's Day, January 1st
Epiphany, January 6th
Good Friday
Easter Monday
May Day, May 1st
Liberation of the Republic, May 8th
SS. Cyril and Methodius, July 5th
Slovak National Uprising, August 29th
Constitution of the Slovak Republic, September 1st
Our Lady of the Seven Sorrows, September 15th
All Saints Day, November 1st
Freedom and Democracy of the Slovak Republic, November 17th
Christmas Eve, December 24th
Christmas, December 25th
St. Stephen, December 26th
References
Budapest Stock Exchange
Copenhagen Stock Exchange
Maundy Thursday
General Prayer Day, 25 days after Easter Monday
Ascension
Whit (Pentecost) Monday
Constitution Day, June 5th
Boxing Day, December 26th
Frankfurt Stock Exchange
Labour Day, May 1st
Christmas' Eve, December 24th
Christmas Holiday, December 26th
New Year's Eve, December 31st
Helsinki Stock Exchange
Ascension Thursday
Midsummer Eve (Friday between June 18-24)
Independence Day, December 6th
Johannesburg Securities Exchange
New Year's Day, January 1st (possibly moved to Monday)
Family Day, Easter Monday
Human Rights Day, March 21st (possibly moved to Monday)
Freedom Day, April 27th (possibly moved to Monday)
Workers Day, May 1st (possibly moved to Monday)
Youth Day, June 16th (possibly moved to Monday)
National Women's Day, August 9th (possibly moved to Monday)
Heritage Day, September 24th (possibly moved to Monday)
Day of Reconciliation, December 16th (possibly moved to Monday)
Christmas December 25th
Day of Goodwill December 26th (possibly moved to Monday)
Milan Stock Exchange
Assumption, August 15th
London Stock Exchange
Early May Bank Holiday, first Monday of May
Spring Bank Holiday, last Monday of May
Summer Bank Holiday, last Monday of August
Christmas Day, December 25th (possibly moved to Monday or Tuesday)
Boxing Day, December 26th (possibly moved to Monday or Tuesday)
New York Stock Exchange
New Year's Day, January 1st (possibly moved to Monday if falls on Sunday)
Martin Luther King's birthday, third Monday in January (since 1998)
Presidents' Day (a.k.a. Washington's birthday), third Monday in February
Memorial Day, last Monday in May
Independence Day, July 4th (moved to Monday if falls on Sunday or Friday if falls on Saturday)
Labor Day, first Monday in September
Thanksgiving Day, fourth Thursday in November
Presidential election day, first Tuesday in November of election years (until 1980)
Christmas, December 25th (moved to Monday if falls on Sunday or Friday if falls on Saturday)
Special historic closings
Oslo Stock Exchange
Holy Thursday
Whit(Pentecost) Monday
National Independence Day, May 17th
Prague Stock Exchange
Liberation Day, May 8th
Jan Hus Day, July 6th
Czech Statehood Day, September 28th
Independence Day, October 28th
Struggle for Freedom and Democracy Day, November 17th
Stockholm Stock Exchange
National Day, June 6th
Christmas Day, December 25th
New Year's Eve, December 31th
Sydney Stock Exchange
Australia Day, January 26th (possibly moved to Monday)
ANZAC Day. April 25th (possibly moved to Monday)
Queen's Birthday, second Monday in June
Bank Holiday, first Monday in August
Labour Day, first Monday in October
Christmas, December 25th (possibly moved to Monday or Tuesday)
Tokyo Stock Exchange
Bank Holiday, January 2nd
Bank Holiday, January 3rd
Coming of Age Day, second Monday in January
National Foundation Day, February 11th
Vernal Equinox
Greenery Day, April 29th
Constitution Memorial Day, May 3rd
Holiday for a Nation, May 4th
Children's Day, May 5th
Marine Day, third Monday in July
Respect for the Aged Day, third Monday in September
Autumnal Equinox
Health and Sports Day, second Monday in October
National Culture Day, November 3rd
Labor Thanksgiving Day, November 23rd
Emperor's Birthday, December 23rd
Bank Holiday, December 31st
Toronto Stock Exchange
Family Day, third Monday of February
Victoria Day, the Monday on or preceding May 24th
Canada Day, July 1st (possibly moved to Monday)
Provincial Holiday, first Monday of August
Labour Day, first Monday of September
Thanksgiving Day, second Monday of October
Remembrance Day, November 11th
United Kingdom General
United States Bond Market
Martin Luther King's birthday, third Monday in January
Columbus Day, second Monday in October
Veterans' Day, November 11th (moved to Monday if falls on Sunday or Friday if falls on Saturday)
United States General
New Year's Day, January 1st (possibly moved to Monday if falls on Sunday, or to Friday if falls on Saturday)
Independence Day, July 4th (moved to Monday if falls on Sunday or to Friday if falls on Saturday)
Veterans' Day, November 11th (moved to Monday if falls on Sunday or to Friday if falls on Saturday)
Christmas, December 25th (moved to Monday if falls on Sunday or to Friday if falls on Saturday)
Warsaw Stock Exchange
Corpus Christi
Constitution Day, May 3rd
Assumption of the Blessed Virgin Mary, August 15th
Independence Day, November 11th
2nd Day of Christmas, December 26th
Wellington Stock Exchange
New Year's Day, January 1st (possibly moved to Monday or Tuesday)
Day after New Year's Day, January 2nd (possibly moved to Monday or Tuesday)
Anniversary Day, Monday nearest January 22nd
Waitangi Day, February 6th
ANZAC Day, April 25th
Queen's Birthday, first Monday in June
Labour Day, fourth Monday in October
Zurich Stock Exchange
Berchtoldstag, January 2nd
Ascension Day
Whit Monday
National Day, August 1st
St. Stephen's Day, December 26th
Cash Flow Analysis worksheet, Day Counters worksheet, Lattice Methods worksheet, Stochastic Processes worksheet, Term Structures worksheet
Download Help Document