QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
constantcpivolatility.cpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2009, 2011 Chris Kenyon
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#include <ql/termstructures/volatility/inflation/constantcpivolatility.hpp>
21#include <ql/quotes/simplequote.hpp>
22
23namespace QuantLib {
24
26 Natural settlementDays,
27 const Calendar& cal,
29 const DayCounter& dc,
30 const Period& observationLag,
31 Frequency frequency,
32 bool indexIsInterpolated)
33 : CPIVolatilitySurface(settlementDays, cal, bdc, dc,
34 observationLag, frequency, indexIsInterpolated),
35 volatility_(vol) {}
36
38 Natural settlementDays,
39 const Calendar& cal,
41 const DayCounter& dc,
42 const Period& observationLag,
43 Frequency frequency,
44 bool indexIsInterpolated)
45 : CPIVolatilitySurface(settlementDays, cal, bdc, dc,
46 observationLag, frequency, indexIsInterpolated),
47 volatility_(ext::make_shared<SimpleQuote>(vol)) {}
48
49
51 return volatility_->value();
52 }
53
54}
55
zero inflation (i.e. CPI/RPI/HICP/etc.) volatility structures
calendar class
Definition: calendar.hpp:61
Volatility volatilityImpl(Time length, Rate strike) const override
ConstantCPIVolatility(const Handle< Quote > &vol, Natural settlementDays, const Calendar &, BusinessDayConvention bdc, const DayCounter &dc, const Period &observationLag, Frequency frequency, bool indexIsInterpolated)
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
market element returning a stored value
Definition: simplequote.hpp:33
Frequency
Frequency of events.
Definition: frequency.hpp:37
BusinessDayConvention
Business Day conventions.
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
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