Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cpiblackcapfloorengine.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016,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/pricingengines/cpiblackcapfloorengine.hpp
20 \brief CPI cap/floor engine using the Black pricing formula and interpreting the volatility data as lognormal vols
21 \ingroup engines
22*/
23
24#ifndef quantext_cpi_black_capfloor_engine_hpp
25#define quantext_cpi_black_capfloor_engine_hpp
26
27#include <ql/instruments/cpicapfloor.hpp>
28#include <ql/termstructures/volatility/inflation/cpivolatilitystructure.hpp>
29#include <ql/termstructures/yieldtermstructure.hpp>
30
31namespace QuantExt {
32
33//! Basse Class for Black / Bachelier CPI cap floor pricing engines
35public:
36 CPICapFloorEngine(const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve,
37 const QuantLib::Handle<QuantLib::CPIVolatilitySurface>& surface,
38 const bool ttmFromLastAvailableFixing = false);
39
40 virtual void calculate() const override;
41
42 virtual ~CPICapFloorEngine() {}
43
44 void setVolatility(const QuantLib::Handle<QuantLib::CPIVolatilitySurface>& surface);
45
46protected:
47 virtual double optionPriceImpl(QuantLib::Option::Type type, double forward, double strike, double stdDev, double discount) const = 0;
48 QuantLib::Handle<QuantLib::YieldTermStructure> discountCurve_;
49 QuantLib::Handle<QuantLib::CPIVolatilitySurface> volatilitySurface_;
51};
52
54public:
55 CPIBlackCapFloorEngine(const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve,
56 const QuantLib::Handle<QuantLib::CPIVolatilitySurface>& surface,
57 const bool ttmFromLastAvailableFixing = false)
58 : CPICapFloorEngine(discountCurve, surface, ttmFromLastAvailableFixing){};
59
60 virtual ~CPIBlackCapFloorEngine() = default;
61
62protected:
63 virtual double optionPriceImpl(QuantLib::Option::Type type, double strike, double forward, double stdDev,
64 double discount) const override;
65};
66
67} // namespace QuantExt
68
69#endif
virtual double optionPriceImpl(QuantLib::Option::Type type, double strike, double forward, double stdDev, double discount) const override
CPIBlackCapFloorEngine(const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::Handle< QuantLib::CPIVolatilitySurface > &surface, const bool ttmFromLastAvailableFixing=false)
virtual ~CPIBlackCapFloorEngine()=default
Basse Class for Black / Bachelier CPI cap floor pricing engines.
QuantLib::Handle< QuantLib::CPIVolatilitySurface > volatilitySurface_
virtual double optionPriceImpl(QuantLib::Option::Type type, double forward, double strike, double stdDev, double discount) const =0
virtual void calculate() const override
QuantLib::Handle< QuantLib::YieldTermStructure > discountCurve_
void setVolatility(const QuantLib::Handle< QuantLib::CPIVolatilitySurface > &surface)