Commodity Forwards Notional Resets (bug?)
Hi there,
I've set up a new commodity forward and run standard stuff similar to Example_24. I've noticed that the notional gets set to the present forward price x quantity similar as if it was resettable daily (see for example notional from NPV of Example_24).
In my opinion, the default for a forward notional should be the forward's agreed price at closure ("strike") x quantity and this notional should not change during the trade's lifetime.
Here's a modified Example_24 (trade's price/"strike" set to 1100) to highlight the issue. Forward from Curve is at 1161.80:
Rgds,
Nick
Can you post your portfolio.xml?
Can you post your portfolio.xml?
It's pretty much an excerpt from portfolio.xml from Example_24. Only "strike" and quantity changed. All other input parameters/files unchanged.
You're right, the problem seems to be in the implementation of CommodityForward::notional()
Real CommodityForward::notional() const {
// try to get the notional from the additional results of the instrument
try {
return instrument_->qlInstrument(true)->result<Real>("currentNotional");
} catch (const std::exception& e) {
if (strcmp(e.what(), "currentNotional not provided"))
ALOG("error when retrieving notional: " << e.what());
}
// if not provided, return null
return Null<Real>();
}
I agree, the notional should most likely be "quantity x strike" as here
https://github.com/OpenSourceRisk/Engine/blob/master/OREData/ored/portfolio/commodityforward.cpp#L149
In general we set the notional in a way that complies with ISDA recommendations for trade reconciliation. We'll confirm that "quantity x strike" is correct and fix this in the next release. Of course you are welcome to open a PR if you want.
(our internal ref: QPR-12213)