Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
discountingfxforwardengine.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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/pricingengines/discountingfxforwardengine.hpp
20 \brief Engine to value an FX Forward off two yield curves
21
22 \ingroup engines
23*/
24
25#ifndef quantext_discounting_fxforward_engine_hpp
26#define quantext_discounting_fxforward_engine_hpp
27
28#include <ql/termstructures/yieldtermstructure.hpp>
29
31
32namespace QuantExt {
33
34//! Discounting FX Forward Engine
35
36/*! This class implements pricing of FX Forwards by discounting the future
37 nominal cash flows using the respective yield curves. The npv is
38 expressed in ccy1. The given currencies ccy1 and ccy2 are matched
39 to the correct fx forward legs. The evaluation date is the
40 reference date of either discounting curve (which must be equal).
41
42 \ingroup engines
43*/
45public:
46 /*! \param ccy1, currency1Discountcurve
47 Currency 1 and its discount curve.y
48 \param ccy2, currency2Discountcurve
49 Currency 2 and its discount curve.
50 \param spotFX
51 The market spot rate quote, given as units of ccy1
52 for one unit of ccy2. The spot rate must be given
53 w.r.t. a settlement equal to the npv date.
54 \param includeSettlementDateFlows, settlementDate
55 If includeSettlementDateFlows is true (false), cashflows
56 on the settlementDate are (not) included in the NPV.
57 If not given the settlement date is set to the
58 npv date.
59 \param npvDate
60 Discount to this date. If not given the npv date
61 is set to the evaluation date
62 */
63 DiscountingFxForwardEngine(const Currency& ccy1, const Handle<YieldTermStructure>& currency1Discountcurve,
64 const Currency& ccy2, const Handle<YieldTermStructure>& currency2Discountcurve,
65 const Handle<Quote>& spotFX,
66 boost::optional<bool> includeSettlementDateFlows = boost::none,
67 const Date& settlementDate = Date(), const Date& npvDate = Date());
68
69 void calculate() const override;
70
71 const Handle<YieldTermStructure>& currency1Discountcurve() const { return currency1Discountcurve_; }
72
73 const Handle<YieldTermStructure>& currency2Discountcurve() const { return currency2Discountcurve_; }
74
75 const Currency& currency1() const { return ccy1_; }
76 const Currency& currency2() const { return ccy2_; }
77
78 const Handle<Quote>& spotFX() const { return spotFX_; }
79
80private:
81 Currency ccy1_;
82 Handle<YieldTermStructure> currency1Discountcurve_;
83 Currency ccy2_;
84 Handle<YieldTermStructure> currency2Discountcurve_;
85 Handle<Quote> spotFX_;
86 boost::optional<bool> includeSettlementDateFlows_;
89};
90} // namespace QuantExt
91
92#endif
const Handle< YieldTermStructure > & currency2Discountcurve() const
Handle< YieldTermStructure > currency2Discountcurve_
Handle< YieldTermStructure > currency1Discountcurve_
const Handle< YieldTermStructure > & currency1Discountcurve() const
defaultable fxforward instrument