Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
datedstrippedoptionletadapter.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/datedstrippedoptionletadapter.hpp
20 \brief StrippedOptionlet Adapter
21 \ingroup termstructures
22*/
23
24#pragma once
25
27
28#include <ql/math/interpolation.hpp>
29#include <ql/termstructures/volatility/optionlet/optionletvolatilitystructure.hpp>
30
31namespace QuantExt {
32using namespace QuantLib;
33
34//! Adapter class for turning a DatedStrippedOptionletBase object into an OptionletVolatilityStructure
35/*! Takes a DatedStrippedOptionletBase and converts it into an OptionletVolatilityStructure with a fixed
36 reference date
37
38 \ingroup termstructures
39*/
40class DatedStrippedOptionletAdapter : public OptionletVolatilityStructure, public LazyObject {
41public:
42 DatedStrippedOptionletAdapter(const QuantLib::ext::shared_ptr<DatedStrippedOptionletBase>& s, const bool flatExtrapolation);
43
44 //! \name TermStructure interface
45 //@{
46 Date maxDate() const override;
47 //@}
48 //! \name VolatilityTermStructure interface
49 //@{
50 Rate minStrike() const override;
51 Rate maxStrike() const override;
52 //@}
53 //! \name LazyObject interface
54 //@{
55 void update() override;
56 void performCalculations() const override;
57 //@}
58
59 VolatilityType volatilityType() const override;
60 Real displacement() const override;
61
62protected:
63 //! \name OptionletVolatilityStructure interface
64 //@{
65 QuantLib::ext::shared_ptr<SmileSection> smileSectionImpl(Time optionTime) const override;
66 Volatility volatilityImpl(Time length, Rate strike) const override;
67 //@}
68
69private:
70 const QuantLib::ext::shared_ptr<DatedStrippedOptionletBase> optionletStripper_;
72 mutable vector<QuantLib::ext::shared_ptr<Interpolation> > strikeInterpolations_;
74};
75
77 TermStructure::update();
78 LazyObject::update();
79}
80} // namespace QuantExt
Adapter class for turning a DatedStrippedOptionletBase object into an OptionletVolatilityStructure.
const QuantLib::ext::shared_ptr< DatedStrippedOptionletBase > optionletStripper_
Volatility volatilityImpl(Time length, Rate strike) const override
vector< QuantLib::ext::shared_ptr< Interpolation > > strikeInterpolations_
QuantLib::ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime) const override
abstract class for optionlet surface with fixed reference date