QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
callablebondconstantvol.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 Allen Kuo
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 callablebondconstantvol.hpp
21 \brief Constant callable-bond volatility
22*/
23
24#ifndef quantlib_callable_bond_constant_volatility_hpp
25#define quantlib_callable_bond_constant_volatility_hpp
26
28#include <ql/time/period.hpp>
29
30namespace QuantLib {
31
32 class Quote;
33
34 //! Constant callable-bond volatility, no time-strike dependence
37 public:
45 const Calendar&,
49 const Calendar&,
52 //! \name TermStructure interface
53 //@{
54 DayCounter dayCounter() const override { return dayCounter_; }
55 Date maxDate() const override { return Date::maxDate(); }
56 //@}
57 //! \name CallableBondConstantVolatility interface
58 //@{
59 const Period& maxBondTenor() const override;
60 Time maxBondLength() const override;
61 Real minStrike() const override;
62 Real maxStrike() const override;
63
64 protected:
65 Volatility volatilityImpl(Time, Time, Rate) const override;
66 ext::shared_ptr<SmileSection> smileSectionImpl(Time optionTime,
67 Time bondLength) const override;
68 Volatility volatilityImpl(const Date&, const Period&, Rate) const override;
69 //@}
70 private:
74 };
75
76
77 // inline definitions
78
80 return maxBondTenor_;
81 }
82
84 return QL_MAX_REAL;
85 }
86
88 return QL_MIN_REAL;
89 }
90
92 return QL_MAX_REAL;
93 }
94
95}
96
97#endif
98
Callable-bond volatility structure.
calendar class
Definition: calendar.hpp:61
Constant callable-bond volatility, no time-strike dependence.
Volatility volatilityImpl(Time, 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
const Period & maxBondTenor() const override
the largest length for which the term structure can return vols
ext::shared_ptr< SmileSection > smileSectionImpl(Time optionTime, Time bondLength) const override
return smile section
DayCounter dayCounter() const override
the day counter used for date/time conversion
Date maxDate() const override
the latest date for which the curve can return values
Time maxBondLength() const override
the largest bondLength for which the term structure can return vols
Real maxStrike() const override
the maximum strike for which the term structure can return vols
Volatility volatility(Time optionTime, Time bondLength, Rate strike, bool extrapolate=false) const
returns the volatility for a given option time and bondLength
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
#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
period- and frequency-related classes and enumerations