QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
constantoptionletvol.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) 2008 Ferdinando Ametrano
5 Copyright (C) 2004, 2005, 2007 StatPro Italia srl
6 Copyright (C) 2015 Peter Caspers
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*! \file constantoptionletvol.hpp
23 \brief Constant caplet/floorlet volatility
24*/
25
26#ifndef quantlib_caplet_constant_volatility_hpp
27#define quantlib_caplet_constant_volatility_hpp
28
30
31namespace QuantLib {
32
33 class Quote;
34
35 //! Constant caplet volatility, no time-strike dependence
37 public:
38 //! floating reference date, floating market data
40 const Calendar& cal,
43 const DayCounter& dc,
45 Real displacement = 0.0);
46 //! fixed reference date, floating market data
48 const Calendar& cal,
51 const DayCounter& dc,
53 Real displacement = 0.0);
54 //! floating reference date, fixed market data
59 Real displacement = 0.0);
60 //! fixed reference date, fixed market data
62 const Calendar &cal,
66 Real displacement = 0.0);
67 //! \name TermStructure interface
68 //@{
69 Date maxDate() const override;
70 //@}
71 //! \name VolatilityTermStructure interface
72 //@{
73 Real minStrike() const override;
74 Real maxStrike() const override;
75 //@}
76 VolatilityType volatilityType() const override;
77 Real displacement() const override;
78
79 protected:
80 ext::shared_ptr<SmileSection> smileSectionImpl(const Date& d) const override;
81 ext::shared_ptr<SmileSection> smileSectionImpl(Time) const override;
82 Volatility volatilityImpl(Time, Rate) const override;
83
84 private:
88 };
89
90
91 // inline definitions
92
94 return Date::maxDate();
95 }
96
98 return QL_MIN_REAL;
99 }
100
102 return QL_MAX_REAL;
103 }
104
105 inline VolatilityType
107 return type_;
108 }
109
111 return displacement_;
112 }
113}
114
115#endif
calendar class
Definition: calendar.hpp:61
Constant caplet volatility, no time-strike dependence.
Volatility volatilityImpl(Time, Rate) const override
implements the actual volatility calculation in derived classes
Real minStrike() const override
the minimum strike for which the term structure can return vols
VolatilityType volatilityType() const override
Date maxDate() const override
the latest date for which the curve can return values
Real maxStrike() const override
the maximum strike for which the term structure can return vols
ext::shared_ptr< SmileSection > smileSectionImpl(const Date &d) const override
Concrete date class.
Definition: date.hpp:125
static Date maxDate()
latest allowed date
Definition: date.cpp:771
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
Optionlet (caplet/floorlet) volatility structure.
Volatility volatility(const Period &optionTenor, Rate strike, bool extrapolate=false) const
returns the volatility for a given option tenor and strike rate
virtual Natural settlementDays() const
the settlementDays used for reference date calculation
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
Date d
BusinessDayConvention
Business Day conventions.
#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
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Volatility
volatility
Definition: types.hpp:78
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
optionlet (caplet/floorlet) volatility structure