24#ifndef quantext_cap_floor_helper_hpp
25#define quantext_cap_floor_helper_hpp
27#include <ql/instruments/capfloor.hpp>
28#include <ql/termstructures/bootstraphelper.hpp>
29#include <ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp>
38class CapFloorHelper :
public QuantLib::RelativeDateBootstrapHelper<QuantLib::OptionletVolatilityStructure> {
73 const QuantLib::Handle<QuantLib::Quote>& quote,
74 const QuantLib::ext::shared_ptr<QuantLib::IborIndex>& iborIndex,
75 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountingCurve,
bool moving =
true,
76 const QuantLib::Date& effectiveDate = QuantLib::Date(),
QuoteType quoteType =
Premium,
77 QuantLib::VolatilityType quoteVolatilityType = QuantLib::Normal,
78 QuantLib::Real quoteDisplacement = 0.0,
bool endOfMonth =
false,
bool firstCapletExcluded =
true);
92 void setTermStructure(QuantLib::OptionletVolatilityStructure* ovts)
override;
97 void accept(QuantLib::AcyclicVisitor&)
override;
121 QuantLib::ext::shared_ptr<QuantLib::CapFloor>
capFloor_;
124 QuantLib::RelinkableHandle<QuantLib::OptionletVolatilityStructure>
ovtsHandle_;
130 QuantLib::Real
npv(QuantLib::Real quote);
QuantLib::Handle< QuantLib::Quote > rawQuote_
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::Date effectiveDate_
bool firstCapletExcluded_
QuantLib::ext::shared_ptr< QuantLib::IborIndex > iborIndex_
QuantLib::Real quoteDisplacement_
QuantLib::ext::shared_ptr< QuantLib::CapFloor > capFloorCopy_
A copy of the underlying instrument that is used in the npv method.
void initializeDates() override
RelativeDateBootstrapHelper interface.
void setTermStructure(QuantLib::OptionletVolatilityStructure *ovts) override
Sets the helper's OptionletVolatilityStructure to ovts and sets up the pricing engine for capFloor_.
QuantLib::ext::shared_ptr< QuantLib::CapFloor > capFloor_
The underlying instrument.
QuoteType
Enum to indicate the type of the quote provided with the CapFloorHelper.
QuantLib::Real impliedQuote() const override
Returns the capFloor_ instrument's premium.
QuantLib::ext::shared_ptr< QuantLib::CapFloor > capFloor() const
Return the cap floor instrument underlying the helper.
QuantLib::VolatilityType quoteVolatilityType_
QuantLib::Handle< QuantLib::YieldTermStructure > discountHandle_
QuantLib::RelinkableHandle< QuantLib::OptionletVolatilityStructure > ovtsHandle_
The OptionletVolatilityStructure Handle that we link to the capFloor_ instrument.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)