Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
spreadedsmilesection2.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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/spreadedsmilesection2.hpp
20 \brief smile section with linear interpolated vol spreads
21 \ingroup termstructures
22*/
23
24#pragma once
25
26#include <ql/math/interpolation.hpp>
27#include <ql/quote.hpp>
28#include <ql/termstructures/volatility/smilesection.hpp>
29
30#include <ql/shared_ptr.hpp>
31
32namespace QuantExt {
33using namespace QuantLib;
34
35class SpreadedSmileSection2 : public SmileSection {
36public:
37 /*! - If stickyAbsMoney = true or if strikes are relative to atm and more than one strike is giv en, the base smile
38 section must provide an ATM level that does not react to changes in the rate levels. Alternatively, baseAtmLevel
39 can be provided.
40 - If stickyAbsMoney = true, simulatedAtmLevel must be provided and represent the ATM
41 level that _does_ react to changes in the rate levels. */
42 SpreadedSmileSection2(const QuantLib::ext::shared_ptr<SmileSection>& base, const std::vector<Real>& volSpreads,
43 const std::vector<Real>& strikes, const bool strikesRelativeToAtm = false,
44 const Real baseAtmLevel = Null<Real>(), const Real simulatedAtmLevel = Null<Real>(),
45 const bool stickyAbsMoney = false);
46 Rate minStrike() const override;
47 Rate maxStrike() const override;
48 Rate atmLevel() const override;
49
50protected:
51 Volatility volatilityImpl(Rate strike) const override;
52
53private:
54 QuantLib::ext::shared_ptr<SmileSection> base_;
55 std::vector<Real> volSpreads_;
56 std::vector<Real> strikes_;
62};
63
64} // namespace QuantExt
Volatility volatilityImpl(Rate strike) const override
QuantLib::ext::shared_ptr< SmileSection > base_
vector< Real > strikes