Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OREData/ored/marketdata/yieldcurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}
Expand Down
11 changes: 10 additions & 1 deletion OREData/ored/portfolio/legdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real>(node, "Notionals", "Notional", "startDate",
Expand Down Expand Up @@ -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() && !schedule_.rules().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.");
Expand Down