QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
cpicouponpricer.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) 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/*! \file cpicouponpricer.hpp
21 \brief zero inflation-coupon pricer
22 */
23
24#ifndef quantlib_cpicouponpricer_hpp
25#define quantlib_cpicouponpricer_hpp
26
27#include <ql/cashflow.hpp>
28#include <ql/option.hpp>
32
33namespace QuantLib {
34
35 //! base pricer for capped/floored CPI coupons N.B. vol-dependent parts are a TODO
36 /*! \note this pricer can already do swaplets but to get
37 volatility-dependent coupons you need to implement the descendents.
38 */
40 public:
42
45
47 ~CPICouponPricer() override = default;
49
51 return capletVol_;
52 }
53
56 }
57
58 virtual void setCapletVolatility(
59 const Handle<CPIVolatilitySurface>& capletVol);
60
61
62 //! \name InflationCouponPricer interface
63 //@{
64 Real swapletPrice() const override;
65 Rate swapletRate() const override;
66 Real capletPrice(Rate effectiveCap) const override;
67 Rate capletRate(Rate effectiveCap) const override;
68 Real floorletPrice(Rate effectiveFloor) const override;
69 Rate floorletRate(Rate effectiveFloor) const override;
70 void initialize(const InflationCoupon&) override;
71 //@}
72
73 virtual Rate accruedRate(Date settlementDate) const;
74
75 protected:
76 virtual Real optionletPrice(Option::Type optionType,
77 Real effStrike) const;
78
79 virtual Real optionletRate(Option::Type optionType,
80 Real effStrike) const;
81
82 /*! Derived classes usually only need to implement this.
83
84 The name of the method is misleading. This actually
85 returns the rate of the optionlet (so not discounted and
86 not accrued).
87 */
89 Real forward, Real stdDev) const;
90
91 /*! \deprecated Don't use this method. In derived classes, override accruedRate.
92 Deprecated in version 1.31.
93 */
94 [[deprecated("Do not use this method. In derived classes, override accruedRate.")]]
95 virtual Rate adjustedFixing(Rate fixing = Null<Rate>()) const;
96
97 // data
102 /*! \deprecated Don't use this data member. A spread doesn't make sense for this coupon.
103 Deprecated in version 1.31.
104 */
105 [[deprecated("Do not use this data member. A spread doesn't make sense for these coupons.")]]
108 };
109
110}
111
112#endif
Base class for cash flows.
Coupon paying the performance of a CPI (zero inflation) index
Definition: cpicoupon.hpp:55
base pricer for capped/floored CPI coupons N.B. vol-dependent parts are a TODO
void initialize(const InflationCoupon &) override
QL_DEPRECATED_DISABLE_WARNING ~CPICouponPricer() override=default
Handle< CPIVolatilitySurface > capletVol_
Real capletPrice(Rate effectiveCap) const override
Rate floorletRate(Rate effectiveFloor) const override
virtual Rate adjustedFixing(Rate fixing=Null< Rate >()) const
virtual QL_DEPRECATED_ENABLE_WARNING Handle< CPIVolatilitySurface > capletVolatility() const
virtual void setCapletVolatility(const Handle< CPIVolatilitySurface > &capletVol)
Handle< YieldTermStructure > nominalTermStructure_
virtual Real optionletPrice(Option::Type optionType, Real effStrike) const
virtual Handle< YieldTermStructure > nominalTermStructure() const
virtual Rate accruedRate(Date settlementDate) const
virtual Real optionletRate(Option::Type optionType, Real effStrike) const
virtual Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const
Rate swapletRate() const override
Real floorletPrice(Rate effectiveFloor) const override
Real swapletPrice() const override
Rate capletRate(Rate effectiveCap) const override
Concrete date class.
Definition: date.hpp:125
Shared handle to an observable.
Definition: handle.hpp:41
Base inflation-coupon class.
Base inflation-coupon pricer.
template class providing a null value for a given type.
Definition: null.hpp:76
Coupon paying a zero-inflation index.
zero inflation (i.e. CPI/RPI/HICP/etc.) volatility structures
QL_REAL Real
real number
Definition: types.hpp:50
Real Spread
spreads on interest rates
Definition: types.hpp:74
Real Rate
interest rates
Definition: types.hpp:70
inflation-coupon pricers
Definition: any.hpp:35
Base option class.
#define QL_DEPRECATED_DISABLE_WARNING
Definition: qldefines.hpp:216
#define QL_DEPRECATED_ENABLE_WARNING
Definition: qldefines.hpp:217