Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
oiscapfloorhelper.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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/oiscapfloorhelper.hpp
20 \brief Helper for bootstrapping optionlet volatilties from ois cap floor volatilities
21 \ingroup termstructures
22*/
23
24#pragma once
25
27
28#include <ql/termstructures/bootstraphelper.hpp>
29#include <ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp>
30
31namespace QuantExt {
32
33class OISCapFloorHelper : public QuantLib::RelativeDateBootstrapHelper<QuantLib::OptionletVolatilityStructure> {
34
35public:
36 //! OISCapFloorHelper, similar to CapFloorHelper
37 OISCapFloorHelper(CapFloorHelper::Type type, const QuantLib::Period& tenor,
38 const QuantLib::Period& rateComputationPeriod, QuantLib::Rate strike,
39 const QuantLib::Handle<QuantLib::Quote>& quote,
40 const QuantLib::ext::shared_ptr<QuantLib::OvernightIndex>& index,
41 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountingCurve, bool moving = true,
42 const QuantLib::Date& effectiveDate = QuantLib::Date(),
44 QuantLib::VolatilityType quoteVolatilityType = QuantLib::Normal,
45 QuantLib::Real quoteDisplacement = 0.0);
46
47 Leg capFloor() const { return capFloor_; }
48
49 void setTermStructure(QuantLib::OptionletVolatilityStructure* ovts) override;
50 QuantLib::Real impliedQuote() const override;
51 void accept(QuantLib::AcyclicVisitor&) override;
52
53private:
54 void initializeDates() override;
55
57 QuantLib::Period tenor_;
58 QuantLib::Period rateComputationPeriod_;
59 QuantLib::Rate strike_;
60 QuantLib::ext::shared_ptr<QuantLib::OvernightIndex> index_;
61 QuantLib::Handle<QuantLib::YieldTermStructure> discountHandle_;
62 bool moving_;
63 QuantLib::Date effectiveDate_;
65 QuantLib::VolatilityType quoteVolatilityType_;
66 QuantLib::Real quoteDisplacement_;
67 QuantLib::Handle<QuantLib::Quote> rawQuote_;
69
71 QuantLib::RelinkableHandle<QuantLib::OptionletVolatilityStructure> ovtsHandle_;
73
74 //! A method to calculate the cap floor premium from a flat cap floor volatility value
75 QuantLib::Real npv(QuantLib::Real quote);
76};
77
78} // namespace QuantExt
Helper for bootstrapping optionlet volatilities from cap floor volatilities.
QuoteType
Enum to indicate the type of the quote provided with the CapFloorHelper.
QuantLib::Handle< QuantLib::Quote > rawQuote_
QuantLib::Period rateComputationPeriod_
QuantLib::Real npv(QuantLib::Real quote)
A method to calculate the cap floor premium from a flat cap floor volatility value.
void accept(QuantLib::AcyclicVisitor &) override
QuantLib::ext::shared_ptr< QuantLib::OvernightIndex > index_
void setTermStructure(QuantLib::OptionletVolatilityStructure *ovts) override
CapFloorHelper::QuoteType quoteType_
QuantLib::Real impliedQuote() const override
QuantLib::VolatilityType quoteVolatilityType_
QuantLib::Handle< QuantLib::YieldTermStructure > discountHandle_
QuantLib::RelinkableHandle< QuantLib::OptionletVolatilityStructure > ovtsHandle_