Skip to content

Commit

Permalink
Improve US GovernmentBond calendar (#2004)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Jul 2, 2024
2 parents 10b2482 + cfe62ae commit 03e7294
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ql/time/calendars/unitedstates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,18 @@ namespace QuantLib {
&& y >= 1983)
// Washington's birthday (third Monday in February)
|| isWashingtonBirthday(d, m, y, w)
// Good Friday (2015, 2021, 2023 are half day due to NFP/SIFMA;
// see <https://www.sifma.org/resources/general/holiday-schedule/>)
|| (dd == em-3 && y != 2015 && y != 2021 && y != 2023)
// Good Friday. Since 1996 it's an early close and not a full market
// close when it coincides with the NFP release date, which is the
// first Friday of the month(*).
// See <https://www.sifma.org/resources/general/holiday-schedule/>
//
// (*) The full rule is "the third Friday after the conclusion of the
// week which includes the 12th of the month". This is usually the
// first Friday of the next month, but can be the second Friday if the
// month has fewer than 31 days. Since Good Friday is always between
// March 20th and April 23rd, it can only coincide with the April NFP,
// which is always on the first Friday, because March has 31 days.
|| (dd == em-3 && (y < 1996 || d > 7))
// Memorial Day (last Monday in May)
|| isMemorialDay(d, m, y, w)
// Juneteenth (Monday if Sunday or Friday if Saturday)
Expand All @@ -308,7 +317,7 @@ namespace QuantLib {
if (// President Bush's Funeral
(y == 2018 && m == December && d == 5)
// Hurricane Sandy
|| (y == 2012 && m == October && (d == 30))
|| (y == 2012 && m == October && d == 30)
// President Reagan's funeral
|| (y == 2004 && m == June && d == 11)
) return false;
Expand Down

0 comments on commit 03e7294

Please sign in to comment.