Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commodity Forwards Notional Resets (bug?) #203

Open
Nick-Git2 opened this issue Dec 9, 2023 · 4 comments
Open

Commodity Forwards Notional Resets (bug?) #203

Nick-Git2 opened this issue Dec 9, 2023 · 4 comments

Comments

@Nick-Git2
Copy link

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:
grafik

Rgds,

Nick

@rkapl123
Copy link
Contributor

rkapl123 commented Dec 9, 2023

Can you post your portfolio.xml?

@Nick-Git2
Copy link
Author

Nick-Git2 commented Dec 9, 2023

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.

grafik

@rkapl123
Copy link
Contributor

rkapl123 commented Dec 9, 2023

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>();
}

@pcaspers
Copy link
Collaborator

pcaspers commented Dec 10, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants