QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
termstructures
volatility
flatsmilesection.hpp
Go to the documentation of this file.
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2007 Ferdinando Ametrano
5
Copyright (C) 2007 François du Vignaud
6
Copyright (C) 2007 Giorgio Facchinetti
7
Copyright (C) 2015 Peter Caspers
8
9
This file is part of QuantLib, a free-software/open-source library
10
for financial quantitative analysts and developers - http://quantlib.org/
11
12
QuantLib is free software: you can redistribute it and/or modify it
13
under the terms of the QuantLib license. You should have received a
14
copy of the license along with this program; if not, please email
15
<quantlib-dev@lists.sf.net>. The license is also available online at
16
<http://quantlib.org/license.shtml>.
17
18
This program is distributed in the hope that it will be useful, but WITHOUT
19
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20
FOR A PARTICULAR PURPOSE. See the license for more details.
21
*/
22
23
/*! \file flatsmilesection.hpp
24
\brief Flat SmileSection
25
*/
26
27
#ifndef quantlib_flat_smile_section_hpp
28
#define quantlib_flat_smile_section_hpp
29
30
#include <
ql/termstructures/volatility/smilesection.hpp
>
31
32
namespace
QuantLib
{
33
34
class
FlatSmileSection
:
public
SmileSection
{
35
public
:
36
FlatSmileSection
(
const
Date
&
d
,
37
Volatility
vol,
38
const
DayCounter
& dc,
39
const
Date
&
referenceDate
=
Date
(),
40
Real
atmLevel
=
Null<Rate>
(),
41
VolatilityType
type =
ShiftedLognormal
,
42
Real
shift
= 0.0);
43
FlatSmileSection
(
Time
exerciseTime
,
44
Volatility
vol,
45
const
DayCounter
& dc,
46
Real
atmLevel
=
Null<Rate>
(),
47
VolatilityType
type =
ShiftedLognormal
,
48
Real
shift
= 0.0);
49
//@{
50
Real
minStrike
()
const override
;
51
Real
maxStrike
()
const override
;
52
Real
atmLevel
()
const override
;
53
//@}
54
protected
:
55
Volatility
volatilityImpl
(
Rate
)
const override
;
56
57
private
:
58
Volatility
vol_
;
59
Real
atmLevel_
;
60
};
61
62
inline
Real
FlatSmileSection::minStrike
()
const
{
63
return
QL_MIN_REAL
-
shift
();
64
}
65
66
inline
Real
FlatSmileSection::maxStrike
()
const
{
67
return
QL_MAX_REAL
;
68
}
69
70
inline
Real
FlatSmileSection::atmLevel
()
const
{
71
return
atmLevel_
;
72
}
73
74
inline
Volatility
FlatSmileSection::volatilityImpl
(
Rate
)
const
{
75
return
vol_
;
76
}
77
78
}
79
80
#endif
QuantLib::Date
Concrete date class.
Definition:
date.hpp:125
QuantLib::DayCounter
day counter class
Definition:
daycounter.hpp:44
QuantLib::FlatSmileSection
Definition:
flatsmilesection.hpp:34
QuantLib::FlatSmileSection::atmLevel
Real atmLevel() const override
Definition:
flatsmilesection.hpp:70
QuantLib::FlatSmileSection::minStrike
Real minStrike() const override
Definition:
flatsmilesection.hpp:62
QuantLib::FlatSmileSection::atmLevel_
Real atmLevel_
Definition:
flatsmilesection.hpp:59
QuantLib::FlatSmileSection::volatilityImpl
Volatility volatilityImpl(Rate) const override
Definition:
flatsmilesection.hpp:74
QuantLib::FlatSmileSection::maxStrike
Real maxStrike() const override
Definition:
flatsmilesection.hpp:66
QuantLib::FlatSmileSection::vol_
Volatility vol_
Definition:
flatsmilesection.hpp:58
QuantLib::Null
template class providing a null value for a given type.
Definition:
null.hpp:76
QuantLib::SmileSection
interest rate volatility smile section
Definition:
smilesection.hpp:39
QuantLib::SmileSection::referenceDate
virtual const Date & referenceDate() const
Definition:
smilesection.hpp:106
QuantLib::SmileSection::exerciseTime
virtual Time exerciseTime() const
Definition:
smilesection.hpp:66
QuantLib::SmileSection::shift
virtual Rate shift() const
Definition:
smilesection.hpp:64
d
Date d
Definition:
exchangeratemanager.cpp:32
QL_MAX_REAL
#define QL_MAX_REAL
Definition:
qldefines.hpp:176
QL_MIN_REAL
#define QL_MIN_REAL
Definition:
qldefines.hpp:175
QuantLib::Time
Real Time
continuous quantity with 1-year units
Definition:
types.hpp:62
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::Volatility
Real Volatility
volatility
Definition:
types.hpp:78
QuantLib::Rate
Real Rate
interest rates
Definition:
types.hpp:70
QuantLib
Definition:
any.hpp:35
QuantLib::VolatilityType
VolatilityType
Definition:
volatilitytype.hpp:32
QuantLib::ShiftedLognormal
@ ShiftedLognormal
Definition:
volatilitytype.hpp:32
smilesection.hpp
Smile section base class.
Generated by
Doxygen
1.9.5