Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
crossccyswapengine.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/crossccyswapengine.hpp
20 \brief Cross currency swap engine
21
22 \ingroup engines
23*/
24
25#ifndef quantext_cross_ccy_swap_engine_hpp
26#define quantext_cross_ccy_swap_engine_hpp
27
28#include <ql/termstructures/yieldtermstructure.hpp>
29
31
32namespace QuantExt {
33
34//! Cross currency swap engine
35
36/*! This class implements an engine for pricing swaps comprising legs that
37 involve two currencies. The npv is expressed in ccy1. The given currencies
38 ccy1 and ccy2 are matched to the correct swap legs. The evaluation date is the
39 reference date of either discounting curve (which must be equal).
40
41 \ingroup engines
42*/
44public:
45 //! \name Constructors
46 //@{
47 /*! \param ccy1
48 Currency 1
49 \param currency1DiscountCurve
50 Discount curve for cash flows in currency 1
51 \param ccy2
52 Currency 2
53 \param currency2DiscountCurve
54 Discount curve for cash flows in currency 2
55 \param spotFX
56 The market spot rate quote, given as units of ccy1
57 for one unit of cc2. The spot rate must be given
58 w.r.t. a settlement equal to the npv date.
59 \param includeSettlementDateFlows, settlementDate
60 If includeSettlementDateFlows is true (false), cashflows
61 on the settlementDate are (not) included in the NPV.
62 If not given the settlement date is set to the
63 npv date.
64 \param npvDate
65 Discount to this date. If not given the npv date
66 is set to the evaluation date
67 \param spotFXSettleDate
68 FX conversion as of this date if specified explicitly
69 */
70 CrossCcySwapEngine(const Currency& ccy1, const Handle<YieldTermStructure>& currency1DiscountCurve,
71 const Currency& ccy2, const Handle<YieldTermStructure>& currency2DiscountCurve,
72 const Handle<Quote>& spotFX, boost::optional<bool> includeSettlementDateFlows = boost::none,
73 const Date& settlementDate = Date(), const Date& npvDate = Date(), const Date& spotFXSettleDate = Date());
74 //@}
75
76 //! \name PricingEngine interface
77 //@{
78 void calculate() const override;
79 //@}
80
81 //! \name Inspectors
82 //@{
83 const Handle<YieldTermStructure>& currency1DiscountCurve() const { return currency1Discountcurve_; }
84 const Handle<YieldTermStructure>& currency2DiscountCurve() const { return currency2Discountcurve_; }
85
86 const Currency& currency1() const { return ccy1_; }
87 const Currency& currency2() const { return ccy2_; }
88
89 const Handle<Quote>& spotFX() const { return spotFX_; }
90 //@}
91
92private:
93 Currency ccy1_;
94 Handle<YieldTermStructure> currency1Discountcurve_;
95 Currency ccy2_;
96 Handle<YieldTermStructure> currency2Discountcurve_;
97 Handle<Quote> spotFX_;
98 boost::optional<bool> includeSettlementDateFlows_;
102};
103} // namespace QuantExt
104
105#endif
Cross currency swap engine.
const Handle< Quote > & spotFX() const
const Currency & currency1() const
const Handle< YieldTermStructure > & currency1DiscountCurve() const
boost::optional< bool > includeSettlementDateFlows_
const Currency & currency2() const
void calculate() const override
Handle< YieldTermStructure > currency2Discountcurve_
Handle< YieldTermStructure > currency1Discountcurve_
const Handle< YieldTermStructure > & currency2DiscountCurve() const
Swap instrument with legs involving two currencies.