Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
crossccybasismtmresetswaphelper.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2018 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 crossccybasismtmresetswaphelper.hpp
20 \brief Cross currency basis swap helper with MTM reset
21 \ingroup termstructures
22*/
23
24#ifndef quantext_cross_ccy_basis_mtmreset_swap_helper_hpp
25#define quantext_cross_ccy_basis_mtmreset_swap_helper_hpp
26
27#include <ql/termstructures/yield/ratehelpers.hpp>
28
30
31namespace QuantExt {
32
33//! Cross Ccy Basis MtM Reset Swap Rate Helper
34/*! Rate helper for bootstrapping over cross currency basis (MtM reset) swap spreads
35
36 The resets are applied to the domestic leg (foreign currency is constant notional)
37
38 Assumes that you have, at a minimum, either:
39 - foreign ccy index with attached YieldTermStructure and discountCurve
40 - domestic ccy with attached YieldTermStructure and discountCurve
41
42 The other leg is then solved for i.e. index curve (if no
43 YieldTermStructure is attached to its index) or discount curve (if
44 its Handle is empty) or both.
45
46 The currencies are deduced from the ibor indexes. The spotFx
47 to be quoted with either of these currencies, this is determined
48 by the invertFxIndex flag. The settlement date of the spot is
49 assumed to be equal to the settlement date of the swap itself.
50
51 \ingroup termstructures
52*/
54public:
56 const Handle<Quote>& spreadQuote, const Handle<Quote>& spotFX, Natural settlementDays,
57 const Calendar& settlementCalendar, const Period& swapTenor, BusinessDayConvention rollConvention,
58 const QuantLib::ext::shared_ptr<QuantLib::IborIndex>& foreignCcyIndex,
59 const QuantLib::ext::shared_ptr<QuantLib::IborIndex>& domesticCcyIndex,
60 const Handle<YieldTermStructure>& foreignCcyDiscountCurve,
61 const Handle<YieldTermStructure>& domesticCcyDiscountCurve,
62 const Handle<YieldTermStructure>& foreignCcyFxFwdRateCurve = Handle<YieldTermStructure>(),
63 const Handle<YieldTermStructure>& domesticCcyFxFwdRateCurve = Handle<YieldTermStructure>(), bool eom = false,
64 bool spreadOnForeignCcy = true, boost::optional<QuantLib::Period> foreignTenor = boost::none,
65 boost::optional<QuantLib::Period> domesticTenor = boost::none, Size foreignPaymentLag = 0,
66 Size domesticPaymentLag = 0, boost::optional<bool> foreignIncludeSpread = boost::none,
67 boost::optional<Period> foreignLookback = boost::none, boost::optional<Size> foreignFixingDays = boost::none,
68 boost::optional<Size> foreignRateCutoff = boost::none, boost::optional<bool> foreignIsAveraged = boost::none,
69 boost::optional<bool> domesticIncludeSpread = boost::none,
70 boost::optional<Period> domesticLookback = boost::none, boost::optional<Size> domesticFixingDays = boost::none,
71 boost::optional<Size> domesticRateCutoff = boost::none, boost::optional<bool> domesticIsAveraged = boost::none,
72 const bool telescopicValueDates = false);
73 //! \name RateHelper interface
74 //@{
75 Real impliedQuote() const override;
76 void setTermStructure(YieldTermStructure*) override;
77 //@}
78 //! \name inspectors
79 //@{
80 QuantLib::ext::shared_ptr<CrossCcyBasisMtMResetSwap> swap() const { return swap_; }
81 //@}
82 //! \name Visitability
83 //@{
84 void accept(AcyclicVisitor&) override;
85 //@}
86
87protected:
88 void initializeDates() override;
89
90 Handle<Quote> spotFX_;
93 Period swapTenor_;
94 BusinessDayConvention rollConvention_;
95 QuantLib::ext::shared_ptr<QuantLib::IborIndex> foreignCcyIndex_;
96 QuantLib::ext::shared_ptr<QuantLib::IborIndex> domesticCcyIndex_;
97 Handle<YieldTermStructure> foreignCcyDiscountCurve_;
98 Handle<YieldTermStructure> domesticCcyDiscountCurve_;
99 Handle<YieldTermStructure> foreignCcyFxFwdRateCurve_;
100 Handle<YieldTermStructure> domesticCcyFxFwdRateCurve_;
102 QuantLib::Period foreignTenor_;
103 QuantLib::Period domesticTenor_;
104
107 // OIS only
108 boost::optional<bool> foreignIncludeSpread_;
109 boost::optional<QuantLib::Period> foreignLookback_;
110 boost::optional<QuantLib::Size> foreignFixingDays_;
111 boost::optional<Size> foreignRateCutoff_;
112 boost::optional<bool> foreignIsAveraged_;
113 boost::optional<bool> domesticIncludeSpread_;
114 boost::optional<QuantLib::Period> domesticLookback_;
115 boost::optional<QuantLib::Size> domesticFixingDays_;
116 boost::optional<Size> domesticRateCutoff_;
117 boost::optional<bool> domesticIsAveraged_;
118
121 QuantLib::ext::shared_ptr<CrossCcyBasisMtMResetSwap> swap_;
122
123 RelinkableHandle<YieldTermStructure> termStructureHandle_;
124 RelinkableHandle<YieldTermStructure> foreignDiscountRLH_;
125 RelinkableHandle<YieldTermStructure> domesticDiscountRLH_;
126 RelinkableHandle<YieldTermStructure> foreignCcyFxFwdRateCurveRLH_;
127 RelinkableHandle<YieldTermStructure> domesticCcyFxFwdRateCurveRLH_;
128
130};
131} // namespace QuantExt
132
133#endif
Cross Ccy Basis MtM Reset Swap Rate Helper.
RelinkableHandle< YieldTermStructure > foreignCcyFxFwdRateCurveRLH_
RelinkableHandle< YieldTermStructure > termStructureHandle_
RelinkableHandle< YieldTermStructure > domesticDiscountRLH_
QuantLib::ext::shared_ptr< QuantLib::IborIndex > domesticCcyIndex_
RelinkableHandle< YieldTermStructure > foreignDiscountRLH_
QuantLib::ext::shared_ptr< CrossCcyBasisMtMResetSwap > swap_
QuantLib::ext::shared_ptr< QuantLib::IborIndex > foreignCcyIndex_
RelinkableHandle< YieldTermStructure > domesticCcyFxFwdRateCurveRLH_
QuantLib::ext::shared_ptr< CrossCcyBasisMtMResetSwap > swap() const
Cross currency basis swap instrument with MTM reset.