Skip to content

Commit 3e0533d

Browse files
Farah Khashmanjenkins
authored andcommitted
QPR-12213: Commodity Forward Notional Change
1 parent 5b39023 commit 3e0533d

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

OREData/ored/portfolio/commodityforward.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void CommodityForward::build(const boost::shared_ptr<EngineFactory>& engineFacto
148148
npvCurrency_ = fixingDate_==Date() ? currency_ : payCcy_;
149149

150150
// notional_ = strike_ * quantity_;
151-
notional_ = Null<Real>(); // is handled by override of notional()
151+
notional_ = strike_ * quantity_;
152152
notionalCurrency_ = currency_;
153153

154154
additionalData_["quantity"] = quantity_;
@@ -168,17 +168,7 @@ void CommodityForward::build(const boost::shared_ptr<EngineFactory>& engineFacto
168168
additionalData_["isdaTransaction"] = string("");
169169
}
170170

171-
Real CommodityForward::notional() const {
172-
// try to get the notional from the additional results of the instrument
173-
try {
174-
return instrument_->qlInstrument(true)->result<Real>("currentNotional");
175-
} catch (const std::exception& e) {
176-
if (strcmp(e.what(), "currentNotional not provided"))
177-
ALOG("error when retrieving notional: " << e.what());
178-
}
179-
// if not provided, return null
180-
return Null<Real>();
181-
}
171+
Real CommodityForward::notional() const { return notional_; }
182172

183173
std::map<AssetClass, std::set<std::string>>
184174
CommodityForward::underlyingIndices(const boost::shared_ptr<ReferenceDataManager>& referenceDataManager) const {

0 commit comments

Comments
 (0)