Skip to content

Commit 02c24f5

Browse files
NathanielVolfangojenkins
authored andcommitted
QPR-11935 -- Add quantity to EquityLeg coupon additional data and initialPrice to TRS
1 parent 19a5059 commit 02c24f5

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

OREData/ored/portfolio/trade.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ void Trade::setLegBasedAdditionalData(const Size i, Size resultLegId) const {
246246
ALOG("original nominal could not be determined for trade " << id() << ", set to zero: " << e.what());
247247
}
248248
additionalData_["originalNotional[" + legID + "]"] = originalNotional;
249+
if (auto eqc = boost::dynamic_pointer_cast<QuantExt::EquityCoupon>(coupon)) {
250+
Real quantity = eqc->quantity();
251+
if (quantity == Null<Real>())
252+
quantity = eqc->legInitialNotional() / eqc->initialPrice();
253+
additionalData_["quantity[" + legID + "]"] = quantity;
254+
}
249255
}
250256
}
251257
for (Size j = 0; j < legs_[i].size(); ++j) {

OREData/ored/portfolio/trswrapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ void TRSWrapperAccrualEngine::calculate() const {
384384

385385
results_.additionalResults["returnCurrency"] = arguments_.returnCurrency_.code();
386386
results_.additionalResults["fundingCurrency"] = arguments_.fundingCurrency_.code();
387+
results_.additionalResults["returnLegInitialPrice"] = arguments_.initialPrice_;
388+
results_.additionalResults["returnLegInitialPriceCurrency"] = arguments_.initialPriceCurrency_.code();
387389

388390
// asset leg valuation (accrual method)
389391

0 commit comments

Comments
 (0)