Skip to content

Commit

Permalink
Improve US GovernmentBond calendar
Browse files Browse the repository at this point in the history
Use a general NFP/SIFMA rule for Good Friday instead of hard-coding 3
specific years.
  • Loading branch information
eltoder committed Jul 1, 2024
1 parent 10b2482 commit 803a642
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ql/time/calendars/unitedstates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ 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/>
|| (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 +310,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 803a642

Please sign in to comment.