QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
spreadedsmilesection.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Mario Pucci
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_spreaded_smile_section_hpp
25#define quantlib_spreaded_smile_section_hpp
26
27#include <ql/termstructures/volatility/smilesection.hpp>
28#include <ql/handle.hpp>
29
30namespace QuantLib {
31
32 class Quote;
33
35 public:
36 SpreadedSmileSection(ext::shared_ptr<SmileSection>, Handle<Quote> spread);
38
39 Real minStrike() const override;
40 Real maxStrike() const override;
41 Real atmLevel() const override;
42 const Date& exerciseDate() const override;
43 Time exerciseTime() const override;
44 const DayCounter& dayCounter() const override;
45 const Date& referenceDate() const override;
46 VolatilityType volatilityType() const override;
47 Rate shift() const override;
49
51 void update() override { notifyObservers(); }
53 protected:
54 Volatility volatilityImpl(Rate strike) const override;
55
56 private:
57 const ext::shared_ptr<SmileSection> underlyingSection_;
59 };
60
62 return underlyingSection_->minStrike();
63 }
64
66 return underlyingSection_->maxStrike();
67 }
68
70 return underlyingSection_->atmLevel();
71 }
72
74 return underlyingSection_->exerciseDate();
75 }
76
78 return underlyingSection_->exerciseTime();
79 }
80
82 return underlyingSection_->dayCounter();
83 }
84
86 return underlyingSection_->referenceDate();
87 }
88
90 return underlyingSection_->volatilityType();
91 }
92
94 return underlyingSection_->shift();
95 }
96}
97
98#endif
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
interest rate volatility smile section
const Date & exerciseDate() const override
const ext::shared_ptr< SmileSection > underlyingSection_
const Date & referenceDate() const override
VolatilityType volatilityType() const override
Volatility volatilityImpl(Rate strike) const override
const DayCounter & dayCounter() const override
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35