Skip to content

Commit

Permalink
Merge 01cbbed into 82e32f9
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Oct 11, 2021
2 parents 82e32f9 + 01cbbed commit 061c7e9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
10 changes: 9 additions & 1 deletion ql/time/calendars/unitedstates.hpp
Expand Up @@ -173,7 +173,15 @@ namespace QuantLib {
LiborImpact, //!< Libor impact calendar
FederalReserve //!< Federal Reserve Bankwire System
};
UnitedStates(Market market = Settlement);

explicit UnitedStates(Market market);

/*! \deprecated Use the other constructor.
Deprecated in version 1.24.
*/
QL_DEPRECATED
UnitedStates()
: UnitedStates(Settlement) {}
};

}
Expand Down
2 changes: 1 addition & 1 deletion test-suite/convertiblebonds.cpp
Expand Up @@ -420,7 +420,7 @@ void ConvertibleBondTest::testRegression() {

Date issueDate(23, July, 2008);
Date maturityDate(1, August, 2013);
Calendar calendar = UnitedStates();
Calendar calendar = UnitedStates(UnitedStates::GovernmentBond);
Schedule schedule = MakeSchedule().from(issueDate)
.to(maturityDate)
.withTenor(6*Months)
Expand Down
2 changes: 1 addition & 1 deletion test-suite/creditdefaultswap.cpp
Expand Up @@ -170,7 +170,7 @@ void CreditDefaultSwapTest::testCachedMarketValue() {

Settings::instance().evaluationDate() = Date(9,June,2006);
Date evalDate = Settings::instance().evaluationDate();
Calendar calendar = UnitedStates();
Calendar calendar = UnitedStates(UnitedStates::GovernmentBond);

std::vector<Date> discountDates = {
evalDate,
Expand Down
4 changes: 2 additions & 2 deletions test-suite/daycounters.cpp
Expand Up @@ -339,7 +339,7 @@ void DayCounterTest::testActualActualWithSemiannualSchedule() {

using namespace day_counters_test;

Calendar calendar = UnitedStates();
Calendar calendar = UnitedStates(UnitedStates::GovernmentBond);
Date fromDate = Date(10, January, 2017);
Date firstCoupon = Date(31, August, 2017);
Date quasiCoupon = Date(28, February, 2017);
Expand Down Expand Up @@ -458,7 +458,7 @@ void DayCounterTest::testActualActualWithAnnualSchedule(){
using namespace day_counters_test;

// Now do an annual schedule
Calendar calendar = UnitedStates();
Calendar calendar = UnitedStates(UnitedStates::GovernmentBond);
Schedule schedule = MakeSchedule()
.from(Date(10, January, 2017))
.withFirstDate(Date(31, August, 2017))
Expand Down
4 changes: 2 additions & 2 deletions test-suite/overnightindexedswap.cpp
Expand Up @@ -500,8 +500,8 @@ void OvernightIndexedSwapTest::testBootstrapRegression() {
Pillar::MaturityDate)));
}

PiecewiseYieldCurve<Discount,LogCubic> curve(0, UnitedStates(), helpers, Actual365Fixed(),
MonotonicLogCubic());
PiecewiseYieldCurve<Discount,LogCubic> curve(0, UnitedStates(UnitedStates::GovernmentBond),
helpers, Actual365Fixed(), MonotonicLogCubic());

BOOST_CHECK_NO_THROW(curve.discount(1.0));
}
Expand Down
6 changes: 3 additions & 3 deletions test-suite/piecewiseyieldcurve.cpp
Expand Up @@ -1102,7 +1102,7 @@ void PiecewiseYieldCurveTest::testSwapRateHelperLastRelevantDate() {
// note that the calendar should be US+UK here actually, but technically it should also work with
// the US calendar only
ext::shared_ptr<RateHelper> helper = ext::make_shared<SwapRateHelper>(
0.02, 50 * Years, UnitedStates(), Semiannual, ModifiedFollowing,
0.02, 50 * Years, UnitedStates(UnitedStates::GovernmentBond), Semiannual, ModifiedFollowing,
Thirty360(Thirty360::BondBasis), usdLibor3m);

PiecewiseYieldCurve<Discount, LogLinear> curve(today, std::vector<ext::shared_ptr<RateHelper> >(1, helper),
Expand All @@ -1118,7 +1118,7 @@ void PiecewiseYieldCurveTest::testSwapRateHelperSpotDate() {
ext::shared_ptr<IborIndex> usdLibor3m = ext::make_shared<USDLibor>(3 * Months);

ext::shared_ptr<SwapRateHelper> helper = ext::make_shared<SwapRateHelper>(
0.02, 5 * Years, UnitedStates(), Semiannual, ModifiedFollowing,
0.02, 5 * Years, UnitedStates(UnitedStates::GovernmentBond), Semiannual, ModifiedFollowing,
Thirty360(Thirty360::BondBasis), usdLibor3m);

Settings::instance().evaluationDate() = Date(11, October, 2019);
Expand Down Expand Up @@ -1467,7 +1467,7 @@ void PiecewiseYieldCurveTest::testIterativeBootstrapRetries() {
for (map<Period, Real>::const_iterator it = arsFwdPoints.begin(); it != arsFwdPoints.end(); ++it) {
Handle<Quote> arsFwd(ext::make_shared<SimpleQuote>(it->second));
instruments.push_back(ext::make_shared<FxSwapRateHelper>(arsFwd, arsSpot, it->first, 2,
UnitedStates(), Following, false, true, usdYts));
UnitedStates(UnitedStates::GovernmentBond), Following, false, true, usdYts));
}

// Create the ARS in USD curve with the default IterativeBootstrap.
Expand Down
10 changes: 5 additions & 5 deletions test-suite/schedule.cpp
Expand Up @@ -889,7 +889,7 @@ void ScheduleTest::testScheduleAlwaysHasAStartDate() {
"always produce a schedule with a start date...");
// Attempt to establish whether the first coupoun payment date is
// always the second element of the constructor.
Calendar calendar = UnitedStates();
Calendar calendar = UnitedStates(UnitedStates::GovernmentBond);
Schedule schedule = MakeSchedule()
.from(Date(10, January, 2017))
.withFirstDate(Date(31, August, 2017))
Expand Down Expand Up @@ -945,7 +945,7 @@ void ScheduleTest::testFirstDateOnMaturity() {
.to(Date(20, December, 2016))
.withFirstDate(Date(20, December, 2016))
.withFrequency(Quarterly)
.withCalendar(UnitedStates())
.withCalendar(UnitedStates(UnitedStates::GovernmentBond))
.withConvention(Unadjusted)
.backwards();

Expand All @@ -960,7 +960,7 @@ void ScheduleTest::testFirstDateOnMaturity() {
.to(Date(20, December, 2016))
.withFirstDate(Date(20, December, 2016))
.withFrequency(Quarterly)
.withCalendar(UnitedStates())
.withCalendar(UnitedStates(UnitedStates::GovernmentBond))
.withConvention(Unadjusted)
.forwards();

Expand All @@ -974,7 +974,7 @@ void ScheduleTest::testNextToLastDateOnStart() {
.to(Date(20, December, 2016))
.withNextToLastDate(Date(20, September, 2016))
.withFrequency(Quarterly)
.withCalendar(UnitedStates())
.withCalendar(UnitedStates(UnitedStates::GovernmentBond))
.withConvention(Unadjusted)
.backwards();

Expand All @@ -989,7 +989,7 @@ void ScheduleTest::testNextToLastDateOnStart() {
.to(Date(20, December, 2016))
.withNextToLastDate(Date(20, September, 2016))
.withFrequency(Quarterly)
.withCalendar(UnitedStates())
.withCalendar(UnitedStates(UnitedStates::GovernmentBond))
.withConvention(Unadjusted)
.backwards();

Expand Down

0 comments on commit 061c7e9

Please sign in to comment.