QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
flatsmilesection.hpp
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
27#ifndef quantlib_flat_smile_section_hpp
28#define quantlib_flat_smile_section_hpp
29
30#include <ql/termstructures/volatility/smilesection.hpp>
31
32namespace QuantLib {
33
35 public:
36 FlatSmileSection(const Date& d,
37 Volatility vol,
38 const DayCounter& dc,
39 const Date& referenceDate = Date(),
42 Real shift = 0.0);
44 Volatility vol,
45 const DayCounter& dc,
48 Real shift = 0.0);
50 Real minStrike() const override;
51 Real maxStrike() const override;
52 Real atmLevel() const override;
54 protected:
55 Volatility volatilityImpl(Rate) const override;
56
57 private:
60 };
61
63 return QL_MIN_REAL - shift();
64 }
65
67 return QL_MAX_REAL;
68 }
69
71 return atmLevel_;
72 }
73
75 return vol_;
76 }
77
78}
79
80#endif
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Real atmLevel() const override
Real minStrike() const override
Volatility volatilityImpl(Rate) const override
Real maxStrike() const override
template class providing a null value for a given type.
Definition: null.hpp:76
interest rate volatility smile section
virtual const Date & referenceDate() const
virtual Time exerciseTime() const
virtual Rate shift() const
#define QL_MAX_REAL
Definition: qldefines.hpp:176
#define QL_MIN_REAL
Definition: qldefines.hpp:175
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