QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
oisratehelper.hpp
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
25#ifndef quantlib_oisratehelper_hpp
26#define quantlib_oisratehelper_hpp
27
28#include <ql/termstructures/yield/ratehelpers.hpp>
29#include <ql/instruments/overnightindexedswap.hpp>
30#include <ql/optional.hpp>
31
32namespace QuantLib {
33
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 Natural 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);
55
56 Real impliedQuote() const override;
59
61 // NOLINTNEXTLINE(cppcoreguidelines-noexcept-swap,performance-noexcept-swap)
62 ext::shared_ptr<OvernightIndexedSwap> swap() const { return swap_; }
64
66 void accept(AcyclicVisitor&) override;
68 protected:
69 void initializeDates() override;
71
74 ext::shared_ptr<OvernightIndex> overnightIndex_;
75
76 ext::shared_ptr<OvernightIndexedSwap> swap_;
78
82
90 ext::optional<bool> endOfMonth_;
91 };
92
95 public:
96 DatedOISRateHelper(const Date& startDate,
97 const Date& endDate,
98 const Handle<Quote>& fixedRate,
99 const ext::shared_ptr<OvernightIndex>& overnightIndex,
100 // exogenous discounting curve
101 Handle<YieldTermStructure> discountingCurve = {},
102 bool telescopicValueDates = false,
104 Natural paymentLag = 0,
105 BusinessDayConvention paymentConvention = Following,
106 Frequency paymentFrequency = Annual,
107 const Calendar& paymentCalendar = Calendar(),
108 const Period& forwardStart = 0 * Days,
109 Spread overnightSpread = 0.0,
110 ext::optional<bool> endOfMonth = ext::nullopt);
112
113 Real impliedQuote() const override;
114 void setTermStructure(YieldTermStructure*) override;
116
118 void accept(AcyclicVisitor&) override;
120 protected:
121 ext::shared_ptr<OvernightIndexedSwap> swap_;
123
128 };
129
130}
131
132#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
Bootstrap helper with date schedule relative to global evaluation date.
Relinkable handle to an observable.
Definition: handle.hpp:112
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
Real Spread
spreads on interest rates
Definition: types.hpp:74
const boost::none_t & nullopt
Definition: optional.cpp:27
Definition: any.hpp:35
Choice
Enumeration for pillar determination alternatives.
@ LastRelevantDate
instruments maturity date