QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
basisswapratehelpers.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2021 StatPro Italia srl
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file basisswapratehelpers.hpp
21 \brief ibor-ibor and ois-ibor basis swap rate helpers
22*/
23
24#ifndef quantlib_basisswapratehelpers_hpp
25#define quantlib_basisswapratehelpers_hpp
26
28
29namespace QuantLib {
30
31 //! Rate helper for bootstrapping over ibor-ibor basis swaps
32 /*! The swap is assumed to pay baseIndex + basis and receive
33 otherIndex. The helper can be used to bootstrap the forecast
34 curve for baseIndex (in which case you'll have to pass
35 bootstrapBaseCurve = true and provide otherIndex with a
36 forecast curve) or the forecast curve for otherIndex (in which
37 case bootstrapBaseCurve = false and baseIndex will need a
38 forecast curve).
39 In both cases, an exogenous discount curve is required.
40 */
42 public:
44 const Period& tenor,
45 Natural settlementDays,
46 Calendar calendar,
47 BusinessDayConvention convention,
48 bool endOfMonth,
49 const ext::shared_ptr<IborIndex>& baseIndex,
50 const ext::shared_ptr<IborIndex>& otherIndex,
51 Handle<YieldTermStructure> discountHandle,
52 bool bootstrapBaseCurve);
53
54 Real impliedQuote() const override;
55 void accept(AcyclicVisitor&) override;
56 private:
57 void initializeDates() override;
59
65 ext::shared_ptr<IborIndex> baseIndex_;
66 ext::shared_ptr<IborIndex> otherIndex_;
69
70 ext::shared_ptr<Swap> swap_;
71
73 };
74
75
76 //! Rate helper for bootstrapping over overnight-ibor basis swaps
77 /*! The swap is assumed to pay baseIndex + basis and receive
78 otherIndex. This helper can be used to bootstrap the forecast
79 curve for otherIndex; baseIndex will need an existing forecast
80 curve. An exogenous discount curve can be passed; if not,
81 the overnight-index curve will be used.
82 */
84 public:
86 const Period& tenor,
87 Natural settlementDays,
88 Calendar calendar,
89 BusinessDayConvention convention,
90 bool endOfMonth,
91 const ext::shared_ptr<OvernightIndex>& baseIndex,
92 const ext::shared_ptr<IborIndex>& otherIndex,
94
95 Real impliedQuote() const override;
96 void accept(AcyclicVisitor&) override;
97 private:
98 void initializeDates() override;
100
106 ext::shared_ptr<OvernightIndex> baseIndex_;
107 ext::shared_ptr<IborIndex> otherIndex_;
109
110 ext::shared_ptr<Swap> swap_;
111
113 };
114
115}
116
117#endif
degenerate base class for the Acyclic Visitor pattern
Definition: visitor.hpp:33
calendar class
Definition: calendar.hpp:61
Shared handle to an observable.
Definition: handle.hpp:41
Rate helper for bootstrapping over ibor-ibor basis swaps.
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
ext::shared_ptr< IborIndex > otherIndex_
ext::shared_ptr< IborIndex > baseIndex_
Rate helper for bootstrapping over overnight-ibor basis swaps.
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
ext::shared_ptr< OvernightIndex > baseIndex_
Bootstrap helper with date schedule relative to global evaluation date.
Relinkable handle to an observable.
Definition: handle.hpp:117
Interest-rate term structure.
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Definition: any.hpp:35
deposit, FRA, futures, and various swap rate helpers