From 2670e86f3518213725343c86f3b6491c02688e5f Mon Sep 17 00:00:00 2001 From: OLEG-KULKOV_agi Date: Fri, 25 Oct 2024 16:55:48 +0200 Subject: [PATCH 1/4] added missing information on the curveID in the wildcarding as needed in case of more than one curve in the same currency --- OREData/ored/marketdata/yieldcurve.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OREData/ored/marketdata/yieldcurve.cpp b/OREData/ored/marketdata/yieldcurve.cpp index c3927f94e3..16a00704dd 100644 --- a/OREData/ored/marketdata/yieldcurve.cpp +++ b/OREData/ored/marketdata/yieldcurve.cpp @@ -1118,7 +1118,7 @@ void YieldCurve::buildDiscountCurve() { marketData = loader_.get(*wildcard, asofDate_); } else { std::ostringstream ss; - ss << MarketDatum::InstrumentType::DISCOUNT << "/" << MarketDatum::QuoteType::RATE << "/" << currency_ << "/*"; + ss << MarketDatum::InstrumentType::DISCOUNT << "/" << MarketDatum::QuoteType::RATE << "/" << currency_ << "/" << curveConfig_->curveID() << "/*"; Wildcard w(ss.str()); marketData = loader_.get(w, asofDate_); } From 3822337e59abe8b39242b5c22defc39c0fce6649 Mon Sep 17 00:00:00 2001 From: OLEG-KULKOV_agi Date: Fri, 1 Nov 2024 11:19:19 +0100 Subject: [PATCH 2/4] align the payment lag of the notional with the payment of the coupon if notional lag is not given as market standard --- OREData/ored/portfolio/legdata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OREData/ored/portfolio/legdata.cpp b/OREData/ored/portfolio/legdata.cpp index 337ced2ed9..08f0b03966 100644 --- a/OREData/ored/portfolio/legdata.cpp +++ b/OREData/ored/portfolio/legdata.cpp @@ -764,7 +764,7 @@ void LegData::fromXML(XMLNode* node) { dayCounter_ = XMLUtils::getChildValue(node, "DayCounter"); // optional paymentConvention_ = XMLUtils::getChildValue(node, "PaymentConvention"); paymentLag_ = XMLUtils::getChildValue(node, "PaymentLag"); - notionalPaymentLag_ = XMLUtils::getChildValue(node, "NotionalPaymentLag"); + notionalPaymentLag_ = XMLUtils::getChildValue(node, "NotionalPaymentLag", false, paymentLag_); paymentCalendar_ = XMLUtils::getChildValue(node, "PaymentCalendar", false); // if not given, default of getChildValueAsBool is true, which fits our needs here notionals_ = XMLUtils::getChildrenValuesWithAttributes(node, "Notionals", "Notional", "startDate", From ebb64808cb59f22d591770b82dda07d2a1422068 Mon Sep 17 00:00:00 2001 From: OLEG-KULKOV_agi Date: Fri, 1 Nov 2024 16:57:16 +0100 Subject: [PATCH 3/4] adjust payment calendar to the schedule calendar to avoid the first being empty --- OREData/ored/portfolio/legdata.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OREData/ored/portfolio/legdata.cpp b/OREData/ored/portfolio/legdata.cpp index 08f0b03966..d3709d59dd 100644 --- a/OREData/ored/portfolio/legdata.cpp +++ b/OREData/ored/portfolio/legdata.cpp @@ -813,6 +813,15 @@ void LegData::fromXML(XMLNode* node) { if (auto tmp = XMLUtils::getChildNode(node, "ScheduleData")) schedule_.fromXML(tmp); + // set payment calendar equal to the schedule calendar if the payment calendar not given + // otherwise the payment calendar is not set and payments of notional can happen before the interest payments + if (paymentCalendar_.empty()) { + auto tmp = schedule_.rules().front().calendar(); + if (!tmp.empty()) { + paymentCalendar_ = tmp; + } + } + paymentDates_ = XMLUtils::getChildrenValues(node, "PaymentDates", "PaymentDate", false); if (!paymentDates_.empty()) { WLOG("Usage of PaymentDates is deprecated, use PaymentSchedule instead."); From 81bf79dad143f8a45fd939d898d52981b87c93a6 Mon Sep 17 00:00:00 2001 From: OLEG-KULKOV_agi Date: Wed, 13 Nov 2024 11:51:30 +0100 Subject: [PATCH 4/4] fixed the case with empty schedule rules --- OREData/ored/portfolio/legdata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OREData/ored/portfolio/legdata.cpp b/OREData/ored/portfolio/legdata.cpp index d3709d59dd..704323512d 100644 --- a/OREData/ored/portfolio/legdata.cpp +++ b/OREData/ored/portfolio/legdata.cpp @@ -815,7 +815,7 @@ void LegData::fromXML(XMLNode* node) { // set payment calendar equal to the schedule calendar if the payment calendar not given // otherwise the payment calendar is not set and payments of notional can happen before the interest payments - if (paymentCalendar_.empty()) { + if (paymentCalendar_.empty() && !schedule_.rules().empty()) { auto tmp = schedule_.rules().front().calendar(); if (!tmp.empty()) { paymentCalendar_ = tmp;