Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
representativefxoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/models/representativefxoption.hpp
20 \brief representative fx option matcher
21 \ingroup models
22*/
23
24#pragma once
25
26#include <ql/cashflow.hpp>
27#include <ql/termstructures/yieldtermstructure.hpp>
28#include <ql/time/date.hpp>
29
30namespace QuantExt {
31
32using namespace QuantLib;
33
34/*! Given cashflows in two currencies and a reference date >= today, find amounts in the two currencies to be paid
35 on the reference date such that the NPV and FX Delta of the original cashflows and the original cashflows
36 as seen from the reference date are equal.
37
38 The output amounts have a sign, i.e. they are received if positive and paid if negative.
39*/
40
42public:
43 // the fx spot should be a FX Spot discounted to today
44 RepresentativeFxOptionMatcher(const std::vector<Leg>& underlying, const std::vector<bool>& isPayer,
45 const std::vector<std::string>& currencies, const Date& referenceDate,
46 const std::string& forCcy, const std::string& domCcy,
47 const Handle<YieldTermStructure>& forCurve,
48 const Handle<YieldTermStructure>& domCurve, const Handle<Quote>& fxSpot,
49 const bool includeRefDateFlows = false);
50
51 std::string currency1() const { return ccy1_; }
52 std::string currency2() const { return ccy2_; }
53 Real amount1() const { return amount1_; }
54 Real amount2() const { return amount2_; }
55
56private:
57 std::string ccy1_, ccy2_;
59};
60
61} // namespace QuantExt