QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
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 return capletVol_;
48 }
49
52 }
53
54 virtual void setCapletVolatility(
55 const Handle<CPIVolatilitySurface>& capletVol);
56
57
58 //! \name InflationCouponPricer interface
59 //@{
60 Real swapletPrice() const override;
61 Rate swapletRate() const override;
62 Real capletPrice(Rate effectiveCap) const override;
63 Rate capletRate(Rate effectiveCap) const override;
64 Real floorletPrice(Rate effectiveFloor) const override;
65 Rate floorletRate(Rate effectiveFloor) const override;
66 void initialize(const InflationCoupon&) override;
67 //@}
68
69 virtual Rate accruedRate(Date settlementDate) const;
70
71 protected:
72 virtual Real optionletPrice(Option::Type optionType,
73 Real effStrike) const;
74
75 virtual Real optionletRate(Option::Type optionType,
76 Real effStrike) const;
77
78 /*! Derived classes usually only need to implement this.
79
80 The name of the method is misleading. This actually
81 returns the rate of the optionlet (so not discounted and
82 not accrued).
83 */
85 Real forward, Real stdDev) const;
86
87 // data
93 };
94
95}
96
97#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
Handle< CPIVolatilitySurface > capletVol_
Real capletPrice(Rate effectiveCap) const override
Rate floorletRate(Rate effectiveFloor) const override
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
virtual Handle< CPIVolatilitySurface > capletVolatility() 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.
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 Rate
interest rates
Definition: types.hpp:70
inflation-coupon pricers
Definition: any.hpp:37
Base option class.