QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
voltermstructure.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
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 voltermstructure.hpp
21 \brief Volatility term structure
22*/
23
24#ifndef quantlib_vol_term_structure_hpp
25#define quantlib_vol_term_structure_hpp
26
27#include <ql/termstructure.hpp>
28
29namespace QuantLib {
30
31 //! Volatility term structure
32 /*! This abstract class defines the interface of concrete
33 volatility structures which will be derived from this one.
34
35 */
37 public:
38 /*! \name Constructors
39 See the TermStructure documentation for issues regarding
40 constructors.
41 */
42 //@{
43 /*! \warning term structures initialized by means of this
44 constructor must manage their own reference date
45 by overriding the referenceDate() method.
46 */
48 const DayCounter& dc = DayCounter());
49 //! initialize with a fixed reference date
51 const Calendar& cal,
53 const DayCounter& dc = DayCounter());
54 //! calculate the reference date based on the global evaluation date
56 const Calendar& cal,
58 const DayCounter& dc = DayCounter());
59 //@}
60 //! the business day convention used in tenor to date conversion
62 //! period/date conversion
63 Date optionDateFromTenor(const Period&) const;
64 //! the minimum strike for which the term structure can return vols
65 virtual Rate minStrike() const = 0;
66 //! the maximum strike for which the term structure can return vols
67 virtual Rate maxStrike() const = 0;
68 protected:
69 //! strike-range check
70 void checkStrike(Rate strike,
71 bool extrapolate) const;
72 private:
74 };
75
76 // inline definitions
77
80 return bdc_;
81 }
82
83 inline Date
85 // swaption style
87 p,
89 }
90}
91
92#endif
calendar class
Definition: calendar.hpp:61
Date advance(const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
Definition: calendar.cpp:130
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Basic term-structure functionality.
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
virtual Calendar calendar() const
the calendar used for reference and/or option date calculation
Volatility term structure.
virtual Rate maxStrike() const =0
the maximum strike for which the term structure can return vols
virtual Rate minStrike() const =0
the minimum strike for which the term structure can return vols
void checkStrike(Rate strike, bool extrapolate) const
strike-range check
virtual BusinessDayConvention businessDayConvention() const
the business day convention used in tenor to date conversion
Date optionDateFromTenor(const Period &) const
period/date conversion
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
base class for term structures