Skip to content

Commit

Permalink
Make Gov USA bond 2023 Good Friday working day (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio authored Mar 23, 2023
2 parents 7220d2c + 57668cd commit d88ed7c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ql/time/calendars/unitedstates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace QuantLib {
return (d >= 22 && d <= 28) && w == Monday && m == October;
}
}

bool isVeteransDayNoSaturday(Day d, Month m, Year y, Weekday w) {
if (y <= 1970 || y >= 1978) {
// November 11th, adjusted, but no Saturday to Friday
Expand All @@ -90,7 +90,7 @@ namespace QuantLib {
&& m == June && y >= 2022;
}
}

UnitedStates::UnitedStates(UnitedStates::Market market) {
// all calendar instances on the same market share the same
// implementation instance
Expand Down Expand Up @@ -282,8 +282,9 @@ namespace QuantLib {
&& y >= 1983)
// Washington's birthday (third Monday in February)
|| isWashingtonBirthday(d, m, y, w)
// Good Friday (2015 was half day due to NFP report)
|| (dd == em-3 && y != 2015)
// 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)
// Memorial Day (last Monday in May)
|| isMemorialDay(d, m, y, w)
// Juneteenth (Monday if Sunday or Friday if Saturday)
Expand All @@ -303,7 +304,7 @@ namespace QuantLib {
|| ((d == 25 || (d == 26 && w == Monday) ||
(d == 24 && w == Friday)) && m == December))
return false;

// Special closings
if (// President Bush's Funeral
(y == 2018 && m == December && d == 5)
Expand All @@ -312,7 +313,7 @@ namespace QuantLib {
// President Reagan's funeral
|| (y == 2004 && m == June && d == 11)
) return false;

return true;
}

Expand All @@ -338,8 +339,8 @@ namespace QuantLib {
return false; // NOLINT(readability-simplify-boolean-expr)
return true;
}


bool UnitedStates::FederalReserveImpl::isBusinessDay(const Date& date) const {
// see https://www.frbservices.org/holidayschedules/ for details
Weekday w = date.weekday();
Expand Down

0 comments on commit d88ed7c

Please sign in to comment.