QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
oisratehelper.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) 2009, 2012 Roland Lichters
5 Copyright (C) 2009, 2012 Ferdinando Ametrano
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21/*! \file oisratehelper.hpp
22 \brief Overnight Indexed Swap (aka OIS) rate helpers
23*/
24
25#ifndef quantlib_oisratehelper_hpp
26#define quantlib_oisratehelper_hpp
27
30#include <ql/optional.hpp>
31
32namespace QuantLib {
33
34 //! Rate helper for bootstrapping over Overnight Indexed Swap rates
36 public:
37 OISRateHelper(Natural settlementDays,
38 const Period& tenor, // swap maturity
39 const Handle<Quote>& fixedRate,
40 const ext::shared_ptr<OvernightIndex>& overnightIndex,
41 // exogenous discounting curve
42 Handle<YieldTermStructure> discountingCurve = {},
43 bool telescopicValueDates = false,
44 Integer paymentLag = 0,
45 BusinessDayConvention paymentConvention = Following,
46 Frequency paymentFrequency = Annual,
47 Calendar paymentCalendar = Calendar(),
48 const Period& forwardStart = 0 * Days,
49 Spread overnightSpread = 0.0,
51 Date customPillarDate = Date(),
53 ext::optional<bool> endOfMonth = ext::nullopt,
54 ext::optional<Frequency> fixedPaymentFrequency = ext::nullopt,
55 Calendar fixedCalendar = Calendar());
56 //! \name RateHelper interface
57 //@{
58 Real impliedQuote() const override;
60 //@}
61 //! \name inspectors
62 //@{
63 // NOLINTNEXTLINE(cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
64 ext::shared_ptr<OvernightIndexedSwap> swap() const { return swap_; }
65 //@}
66 //! \name Visitability
67 //@{
68 void accept(AcyclicVisitor&) override;
69 //@}
70 protected:
71 void initializeDates() override;
73
76 ext::shared_ptr<OvernightIndex> overnightIndex_;
77
78 ext::shared_ptr<OvernightIndexedSwap> swap_;
80
84
92 ext::optional<bool> endOfMonth_;
93 ext::optional<Frequency> fixedPaymentFrequency_;
95 };
96
97 //! Rate helper for bootstrapping over Overnight Indexed Swap rates
99 public:
100 DatedOISRateHelper(const Date& startDate,
101 const Date& endDate,
102 const Handle<Quote>& fixedRate,
103 const ext::shared_ptr<OvernightIndex>& overnightIndex,
104 // exogenous discounting curve
105 Handle<YieldTermStructure> discountingCurve = {},
106 bool telescopicValueDates = false,
108 Integer paymentLag = 0,
109 BusinessDayConvention paymentConvention = Following,
110 Frequency paymentFrequency = Annual,
111 const Calendar& paymentCalendar = Calendar(),
112 Spread overnightSpread = 0.0,
113 ext::optional<bool> endOfMonth = ext::nullopt,
114 ext::optional<Frequency> fixedPaymentFrequency = ext::nullopt,
115 const Calendar& fixedCalendar = Calendar());
116
117 /*! \deprecated Use the overload without forward start.
118 Deprecated in version 1.35.
119 */
121 DatedOISRateHelper(const Date& startDate,
122 const Date& endDate,
123 const Handle<Quote>& fixedRate,
124 const ext::shared_ptr<OvernightIndex>& overnightIndex,
125 // exogenous discounting curve
126 Handle<YieldTermStructure> discountingCurve,
127 bool telescopicValueDates,
128 RateAveraging::Type averagingMethod,
129 Integer paymentLag,
130 BusinessDayConvention paymentConvention,
131 Frequency paymentFrequency,
132 const Calendar& paymentCalendar,
133 const Period& forwardStart,
134 Spread overnightSpread = 0.0,
135 ext::optional<bool> endOfMonth = ext::nullopt,
136 ext::optional<Frequency> fixedPaymentFrequency = ext::nullopt,
137 const Calendar& fixedCalendar = Calendar());
138
139 //! \name RateHelper interface
140 //@{
141 Real impliedQuote() const override;
142 void setTermStructure(YieldTermStructure*) override;
143 //@}
144 //! \name Visitability
145 //@{
146 void accept(AcyclicVisitor&) override;
147 //@}
148 protected:
149 ext::shared_ptr<OvernightIndexedSwap> swap_;
151
156 };
157
158}
159
160#endif
degenerate base class for the Acyclic Visitor pattern
Definition: visitor.hpp:33
Base helper class for bootstrapping.
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
Rate helper for bootstrapping over Overnight Indexed Swap rates.
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
RateAveraging::Type averagingMethod_
ext::shared_ptr< OvernightIndexedSwap > swap_
Real impliedQuote() const override
Shared handle to an observable.
Definition: handle.hpp:41
Rate helper for bootstrapping over Overnight Indexed Swap rates.
ext::shared_ptr< OvernightIndex > overnightIndex_
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
Pillar::Choice pillarChoice_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
ext::optional< bool > endOfMonth_
RateAveraging::Type averagingMethod_
void initializeDates() override
ext::shared_ptr< OvernightIndexedSwap > swap_
BusinessDayConvention paymentConvention_
Real impliedQuote() const override
ext::shared_ptr< OvernightIndexedSwap > swap() const
ext::optional< Frequency > fixedPaymentFrequency_
Bootstrap helper with date schedule relative to global evaluation date.
Relinkable handle to an observable.
Definition: handle.hpp:117
Interest-rate term structure.
Frequency
Frequency of events.
Definition: frequency.hpp:37
BusinessDayConvention
Business Day conventions.
@ Annual
once a year
Definition: frequency.hpp:39
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
QL_INTEGER Integer
integer number
Definition: types.hpp:35
Real Spread
spreads on interest rates
Definition: types.hpp:74
const boost::none_t & nullopt
Definition: optional.cpp:27
Definition: any.hpp:35
Maps optional to either the boost or std implementation.
Overnight index swap paying compounded overnight vs. fixed.
#define QL_DEPRECATED
Definition: qldefines.hpp:215
deposit, FRA, futures, and various swap rate helpers
Choice
Enumeration for pillar determination alternatives.
@ LastRelevantDate
instruments maturity date