Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
oisratehelper.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/termstructures/oisratehelper.hpp
20 \brief Overnight Indexed Swap (aka OIS) rate helpers
21 \ingroup termstructures
22*/
23
24#ifndef quantext_oisratehelper_hpp
25#define quantext_oisratehelper_hpp
26
27#include <ql/instruments/overnightindexedswap.hpp>
28#include <ql/termstructures/yield/ratehelpers.hpp>
29
30namespace QuantExt {
31using namespace QuantLib;
32
33//! Rate helper for bootstrapping using Overnight Indexed Swaps
34/*! \ingroup termstructures
35 */
37public:
38 OISRateHelper(Natural settlementDays, const Period& swapTenor, const Handle<Quote>& fixedRate,
39 const QuantLib::ext::shared_ptr<OvernightIndex>& overnightIndex, const DayCounter& fixedDayCounter,
40 const Calendar& fixedCalendar, Natural paymentLag = 0, bool endOfMonth = false,
41 Frequency paymentFrequency = Annual, BusinessDayConvention fixedConvention = Following,
42 BusinessDayConvention paymentAdjustment = Following,
43 DateGeneration::Rule rule = DateGeneration::Backward,
44 const Handle<YieldTermStructure>& discountingCurve = Handle<YieldTermStructure>(),
45 bool telescopicValueDates = false, Pillar::Choice pillar = Pillar::LastRelevantDate,
46 Date customPillarDate = Date());
47 //! \name RateHelper interface
48 //@{
49 Real impliedQuote() const override;
50 void setTermStructure(YieldTermStructure*) override;
51 //@}
52 //! \name inspectors
53 //@{
54 QuantLib::ext::shared_ptr<OvernightIndexedSwap> swap() const { return swap_; }
55 //@}
56 //! \name Visitability
57 //@{
58 void accept(AcyclicVisitor&) override;
59 //@}
60protected:
61 void initializeDates() override;
62
64 Period swapTenor_;
65 QuantLib::ext::shared_ptr<OvernightIndex> overnightIndex_;
66 DayCounter fixedDayCounter_;
68 Natural paymentLag_;
71 BusinessDayConvention fixedConvention_;
72 BusinessDayConvention paymentAdjustment_;
73 DateGeneration::Rule rule_;
74
75 QuantLib::ext::shared_ptr<OvernightIndexedSwap> swap_;
76 RelinkableHandle<YieldTermStructure> termStructureHandle_;
77 Handle<YieldTermStructure> discountHandle_;
78 RelinkableHandle<YieldTermStructure> discountRelinkableHandle_;
80 Pillar::Choice pillarChoice_;
81};
82
83//! Rate helper for bootstrapping using Overnight Indexed Swaps
84/*! \ingroup termstructures
85 */
86class DatedOISRateHelper : public RateHelper {
87public:
88 DatedOISRateHelper(const Date& startDate, const Date& endDate, const Handle<Quote>& fixedRate,
89 const QuantLib::ext::shared_ptr<OvernightIndex>& overnightIndex, const DayCounter& fixedDayCounter,
90 const Calendar& fixedCalendar, Natural paymentLag = 0, Frequency paymentFrequency = Annual,
91 BusinessDayConvention fixedConvention = Following,
92 BusinessDayConvention paymentAdjustment = Following,
93 DateGeneration::Rule rule = DateGeneration::Backward,
94 const Handle<YieldTermStructure>& discountingCurve = Handle<YieldTermStructure>(),
95 bool telescopicValueDates = false, Pillar::Choice pillar = Pillar::LastRelevantDate,
96 Date customPillarDate = Date());
97
98 //! \name RateHelper interface
99 //@{
100 Real impliedQuote() const override;
101 void setTermStructure(YieldTermStructure*) override;
102 //@}
103 //! \name Visitability
104 //@{
105 void accept(AcyclicVisitor&) override;
106 //@}
107protected:
108 QuantLib::ext::shared_ptr<OvernightIndex> overnightIndex_;
111 Natural paymentLag_;
113 BusinessDayConvention fixedConvention_;
114 BusinessDayConvention paymentAdjustment_;
115 DateGeneration::Rule rule_;
116
117 QuantLib::ext::shared_ptr<OvernightIndexedSwap> swap_;
118 RelinkableHandle<YieldTermStructure> termStructureHandle_;
119 Handle<YieldTermStructure> discountHandle_;
120 RelinkableHandle<YieldTermStructure> discountRelinkableHandle_;
122 Pillar::Choice pillarChoice_;
123};
124} // namespace QuantExt
125
126#endif
Rate helper for bootstrapping using Overnight Indexed Swaps.
BusinessDayConvention paymentAdjustment_
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
BusinessDayConvention fixedConvention_
QuantLib::ext::shared_ptr< OvernightIndex > overnightIndex_
RelinkableHandle< YieldTermStructure > termStructureHandle_
Handle< YieldTermStructure > discountHandle_
QuantLib::ext::shared_ptr< OvernightIndexedSwap > swap_
void accept(AcyclicVisitor &) override
DateGeneration::Rule rule_
Real impliedQuote() const override
Rate helper for bootstrapping using Overnight Indexed Swaps.
BusinessDayConvention paymentAdjustment_
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
BusinessDayConvention fixedConvention_
QuantLib::ext::shared_ptr< OvernightIndex > overnightIndex_
RelinkableHandle< YieldTermStructure > termStructureHandle_
Pillar::Choice pillarChoice_
Handle< YieldTermStructure > discountHandle_
QuantLib::ext::shared_ptr< OvernightIndexedSwap > swap_
void accept(AcyclicVisitor &) override
DateGeneration::Rule rule_
void initializeDates() override
Real impliedQuote() const override
QuantLib::ext::shared_ptr< OvernightIndexedSwap > swap() const