20#include <ql/instruments/makecapfloor.hpp>
21#include <ql/instruments/makeswaption.hpp>
22#include <ql/pricingengines/blackformula.hpp>
23#include <ql/termstructures/volatility/gaussian1dsmilesection.hpp>
31 const Date& fixingDate,
32 ext::shared_ptr<SwapIndex> swapIndex,
33 const ext::shared_ptr<Gaussian1dModel>& model,
35 const ext::shared_ptr<Gaussian1dSwaptionEngine>& swaptionEngine)
36 :
SmileSection(fixingDate, dc, model->termStructure()->referenceDate()),
37 fixingDate_(fixingDate), swapIndex_(
std::move(swapIndex)), model_(model),
38 engine_(swaptionEngine) {
45 engine_ = ext::make_shared<Gaussian1dSwaptionEngine>(
51 const Date& fixingDate,
52 ext::shared_ptr<IborIndex> iborIndex,
53 const ext::shared_ptr<Gaussian1dModel>& model,
55 const ext::shared_ptr<Gaussian1dCapFloorEngine>& capEngine)
56 :
SmileSection(fixingDate, dc, model->termStructure()->referenceDate()),
57 fixingDate_(fixingDate), iborIndex_(
std::move(iborIndex)), model_(model), engine_(capEngine) {
67 engine_ = ext::make_shared<Gaussian1dCapFloorEngine>(
76 Real discount)
const {
Base class for cap-like instruments.
Date maturityDate() const
Real atmLevel() const override
ext::shared_ptr< IborIndex > iborIndex_
ext::shared_ptr< SwapIndex > swapIndex_
ext::shared_ptr< PricingEngine > engine_
ext::shared_ptr< Gaussian1dModel > model_
Gaussian1dSmileSection(const Date &fixingDate, ext::shared_ptr< SwapIndex > swapIndex, const ext::shared_ptr< Gaussian1dModel > &model, const DayCounter &dc, const ext::shared_ptr< Gaussian1dSwaptionEngine > &swaptionEngine=ext::shared_ptr< Gaussian1dSwaptionEngine >())
Real optionPrice(Rate strike, Option::Type=Option::Call, Real discount=1.0) const override
Real volatilityImpl(Rate strike) const override
Real NPV() const
returns the net present value of the instrument.
MakeCapFloor & withEffectiveDate(const Date &effectiveDate, bool firstCapletExcluded)
MakeCapFloor & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
MakeSwaption & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
MakeSwaption & withUnderlyingType(Swap::Type type)
template class providing a null value for a given type.
interest rate volatility smile section
virtual Time exerciseTime() const
Real blackFormulaImpliedStdDev(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement, Real guess, Real accuracy, Natural maxIterations)