QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
constantcapfloortermvol.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
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
20/*! \file constantcapfloortermvol.hpp
21 \brief Constant cap/floor term volatility
22*/
23
24#ifndef quantlib_constant_capfloor_term_volatility_hpp
25#define quantlib_constant_capfloor_term_volatility_hpp
26
28
29namespace QuantLib {
30
31 class Quote;
32
33 //! Constant caplet volatility, no time-strike dependence
35 public:
36 //! floating reference date, floating market data
38 const Calendar& cal,
41 const DayCounter& dc);
42 //! fixed reference date, floating market data
44 const Calendar& cal,
47 const DayCounter& dc);
48 //! floating reference date, fixed market data
50 const Calendar& cal,
53 const DayCounter& dc);
54 //! fixed reference date, fixed market data
56 const Calendar& cal,
59 const DayCounter& dc);
60 //! \name TermStructure interface
61 //@{
62 Date maxDate() const override;
63 //@}
64 //! \name VolatilityTermStructure interface
65 //@{
66 Real minStrike() const override;
67 Real maxStrike() const override;
68 //@}
69 protected:
70 Volatility volatilityImpl(Time, Rate) const override;
71
72 private:
74 };
75
76
77 // inline definitions
78
80 return Date::maxDate();
81 }
82
84 return QL_MIN_REAL;
85 }
86
88 return QL_MAX_REAL;
89 }
90
91}
92
93#endif
cap/floor term-volatility structure
calendar class
Definition: calendar.hpp:61
Volatility volatility(const Period &length, Rate strike, bool extrapolate=false) const
returns the volatility for a given cap/floor length and strike rate
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
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
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
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
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