Skip to content

Commit 126c4a1

Browse files
pcaspersjenkins
authored andcommitted
QPR-11935 -- Add currentQuantity to equity leg (and relabel quantity to initialQuantity)
1 parent 12222c5 commit 126c4a1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

OREData/ored/portfolio/trade.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ void Trade::setLegBasedAdditionalData(const Size i, Size resultLegId) const {
253253
quantity = eqc->legInitialNotional() / eqc->initialPrice();
254254
}
255255
}
256-
additionalData_["quantity[" + legID + "]"] = quantity;
256+
additionalData_["initialQuantity[" + legID + "]"] = quantity;
257+
258+
Real currentPrice = eqc->equityCurve()->fixing(asof);
259+
if (currentPrice != Null<Real>() && originalNotional != Null<Real>())
260+
additionalData_["currentQuantity" + legID + "]"] = originalNotional / currentPrice;
257261
}
258262
}
259263
}

0 commit comments

Comments
 (0)