Skip to content

Commit 3524a6d

Browse files
committed
fixed notional calculation for commodityforwards
1 parent 8512e27 commit 3524a6d

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

OREData/ored/portfolio/commodityforward.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ void CommodityForward::build(const boost::shared_ptr<EngineFactory>& engineFacto
146146
instrument_ = boost::make_shared<VanillaInstrument>(commodityForward);
147147
npvCurrency_ = fixingDate_==Date() ? currency_ : payCcy_;
148148

149-
// notional_ = strike_ * quantity_;
150-
notional_ = Null<Real>(); // is handled by override of notional()
149+
notional_ = strike_ * quantity_;
151150
notionalCurrency_ = currency_;
152151

153152
additionalData_["quantity"] = quantity_;
@@ -167,18 +166,6 @@ void CommodityForward::build(const boost::shared_ptr<EngineFactory>& engineFacto
167166
additionalData_["isdaTransaction"] = string("");
168167
}
169168

170-
Real CommodityForward::notional() const {
171-
// try to get the notional from the additional results of the instrument
172-
try {
173-
return instrument_->qlInstrument(true)->result<Real>("currentNotional");
174-
} catch (const std::exception& e) {
175-
if (strcmp(e.what(), "currentNotional not provided"))
176-
ALOG("error when retrieving notional: " << e.what());
177-
}
178-
// if not provided, return null
179-
return Null<Real>();
180-
}
181-
182169
std::map<AssetClass, std::set<std::string>>
183170
CommodityForward::underlyingIndices(const boost::shared_ptr<ReferenceDataManager>& referenceDataManager) const {
184171
return {{AssetClass::COM, std::set<std::string>({commodityName_})}};

0 commit comments

Comments
 (0)