Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
constantcpivolatility.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
21
22namespace QuantExt {
23
24ConstantCPIVolatility::ConstantCPIVolatility(const QuantLib::Volatility v, QuantLib::Natural settlementDays,
25 const QuantLib::Calendar& cal, QuantLib::BusinessDayConvention bdc,
26 const QuantLib::DayCounter& dc, const QuantLib::Period& observationLag,
27 QuantLib::Frequency frequency, bool indexIsInterpolated,
28 const QuantLib::Date& capFloorStartDate, QuantLib::VolatilityType volType,
29 double displacement)
30 : QuantExt::CPIVolatilitySurface(settlementDays, cal, bdc, dc, observationLag, frequency, indexIsInterpolated,
31 capFloorStartDate, volType, displacement),
32 constantVol_(v){}
33
34QuantLib::Volatility ConstantCPIVolatility::volatilityImpl(QuantLib::Time length, QuantLib::Rate strike) const {
35 return constantVol_;
36};
37
38QuantLib::Real ConstantCPIVolatility::atmStrike(const QuantLib::Date& maturity, const QuantLib::Period& obsLag) const {
39 // Not relevant for constantCPIVolatiltiy;
40 return 0.0;
41};
42
43} // namespace QuantExt
ConstantCPIVolatility(QuantLib::Volatility v, QuantLib::Natural settlementDays, const QuantLib::Calendar &, QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter &dc, const QuantLib::Period &observationLag, QuantLib::Frequency frequency, bool indexIsInterpolated, const QuantLib::Date &capFloorStartDate=QuantLib::Date(), QuantLib::VolatilityType volType=QuantLib::ShiftedLognormal, double displacement=0.0)
QuantLib::Real atmStrike(const QuantLib::Date &maturity, const QuantLib::Period &obsLag=QuantLib::Period(-1, QuantLib::Days)) const override
virtual QuantLib::Volatility volatilityImpl(QuantLib::Time length, QuantLib::Rate strike) const override
Constant CPI Volatility Surface.
some inflation related utilities.