Skip to content

Commit

Permalink
Add docstring with references for US-FED calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
gbfredrik committed Dec 18, 2023
1 parent fa81ccf commit 9160717
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ql/time/calendars/unitedstates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Copyright (C) 2003, 2004, 2005, 2006 StatPro Italia srl
Copyright (C) 2017 Peter Caspers
Copyright (C) 2017 Oleg Kulkov
Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ)
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Expand Down Expand Up @@ -35,7 +36,7 @@ namespace QuantLib {
// third Monday in February
return (d >= 15 && d <= 21) && w == Monday && m == February;
} else {
// February 22nd, possily adjusted
// February 22nd, possibly adjusted
return (d == 22 || (d == 23 && w == Monday)
|| (d == 21 && w == Friday)) && m == February;
}
Expand Down
23 changes: 23 additions & 0 deletions ql/time/calendars/unitedstates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Copyright (C) 2004 Ferdinando Ametrano
Copyright (C) 2017 Peter Caspers
Copyright (C) 2017 Oleg Kulkov
Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ)
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
Expand Down Expand Up @@ -125,6 +126,28 @@ namespace QuantLib {
<li>Christmas, December 25th (moved to Monday if Sunday)</li>
</ul>
Holidays for the Federal Reserve Bankwire System
(data from https://www.federalreserve.gov/aboutthefed/k8.htm
and https://www.frbservices.org/about/holiday-schedules):
<ul>
<li>Saturdays</li>
<li>Sundays</li>
<li>New Year's Day, January 1st (possibly moved to Monday if
actually on Sunday)</li>
<li>Martin Luther King's birthday, third Monday in January (since
1983)</li>
<li>Presidents' Day (a.k.a. Washington's birthday),
third Monday in February</li>
<li>Memorial Day, last Monday in May</li>
<li>Juneteenth, June 19th (moved to Monday if Sunday)</li>
<li>Independence Day, July 4th (moved to Monday if Sunday)</li>
<li>Labor Day, first Monday in September</li>
<li>Columbus Day, second Monday in October</li>
<li>Veterans' Day, November 11th (moved to Monday if Sunday)</li>
<li>Thanksgiving Day, fourth Thursday in November</li>
<li>Christmas, December 25th (moved to Monday if Sunday)</li>
</ul>
\ingroup calendars
\test the correctness of the returned results is tested
Expand Down

0 comments on commit 9160717

Please sign in to comment.