QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
spreadedswaptionvol.hpp
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) 2007 Giorgio Facchinetti
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
26#ifndef quantlib_spreaded_swaption_volstructure_h
27#define quantlib_spreaded_swaption_volstructure_h
28
29#include <ql/termstructures/volatility/swaption/swaptionvolstructure.hpp>
30
31namespace QuantLib {
32
33 class Quote;
34
36 public:
38 Handle<Quote> spread);
39 // All virtual methods of base classes must be forwarded
41
42 DayCounter dayCounter() const override;
43 Date maxDate() const override;
44 Time maxTime() const override;
45 const Date& referenceDate() const override;
46 Calendar calendar() const override;
47 Natural settlementDays() const override;
49
51 Rate minStrike() const override;
52 Rate maxStrike() const override;
54
56 const Period& maxSwapTenor() const override;
58 VolatilityType volatilityType() const override;
59
60 protected:
62
63 ext::shared_ptr<SmileSection> smileSectionImpl(const Date& optionDate,
64 const Period& swapTenor) const override;
65 ext::shared_ptr<SmileSection> smileSectionImpl(Time optionTime,
66 Time swapLength) const override;
68 volatilityImpl(const Date& optionDate, const Period& swapTenor, Rate strike) const override;
69 Volatility volatilityImpl(Time optionTime, Time swapLength, Rate strike) const override;
70 Real shiftImpl(Time optionTime, Time swapLength) const override;
72 private:
75 };
76
78 return baseVol_->dayCounter();
79 }
80
82 return baseVol_->maxDate();
83 }
84
86 return baseVol_->maxTime();
87 }
88
90 return baseVol_->referenceDate();
91 }
92
94 return baseVol_->calendar();
95 }
96
98 return baseVol_->settlementDays();
99 }
100
102 return baseVol_->minStrike();
103 }
104
106 return baseVol_->maxStrike();
107 }
108
110 return baseVol_->maxSwapTenor();
111 }
112
114 Time swapLength) const {
115 return baseVol_->shift(optionTime, swapLength, true);
116 }
117
119 return baseVol_->volatilityType();
120 }
121
122
123
124}
125
126#endif
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
Calendar calendar() const override
the calendar used for reference and/or option date calculation
Rate maxStrike() const override
the maximum strike for which the term structure can return vols
Rate minStrike() const override
the minimum strike for which the term structure can return vols
const Date & referenceDate() const override
the date at which discount = 1.0 and/or variance = 0.0
Real shiftImpl(Time optionTime, Time swapLength) const override
Volatility volatilityImpl(const Date &optionDate, const Period &swapTenor, Rate strike) const override
VolatilityType volatilityType() const override
volatility type
Natural settlementDays() const override
the settlementDays used for reference date calculation
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
ext::shared_ptr< SmileSection > smileSectionImpl(const Date &optionDate, const Period &swapTenor) const override
const Handle< SwaptionVolatilityStructure > baseVol_
const Period & maxSwapTenor() const override
the largest length for which the term structure can return vols
Time maxTime() const override
the latest time for which the curve can return values
Time swapLength(const Period &swapTenor) const
implements the conversion between swap tenor and swap (time) length
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