QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
zeroinflationcashflow.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) 2021 Ralf Konrad Eckel
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 zeroinflationcashflow.hpp
21 \brief Cash flow dependent on an inflation index ratio (NOT a coupon, i.e. no accruals).
22*/
23
24#ifndef quantlib_inflation_cash_flow_hpp
25#define quantlib_inflation_cash_flow_hpp
26
29
30namespace QuantLib {
31
32 //! Cash flow dependent on a zero inflation index ratio.
33 /*! The ratio is taken between fixings observed at the start date
34 and the end date minus the observation lag; that is, if the start
35 and end dates are, e.g., in June and the observation lag is three
36 months, the ratio will be taken between March fixings.
37 */
39 public:
40 /*! The fixings dates for the index are `startDate - observationLag` and
41 `endDate - observationLag`.
42 */
44 const ext::shared_ptr<ZeroInflationIndex>& index,
46 const Date& startDate,
47 const Date& endDate,
48 const Period& observationLag,
49 const Date& paymentDate,
50 bool growthOnly = false);
51
52 //! \name ZeroInflationCashFlow interface
53 //@{
54 ext::shared_ptr<ZeroInflationIndex> zeroInflationIndex() const {
56 }
59 }
60 //@}
61
62 //! \name CashFlow interface
63 //@{
64 void performCalculations() const override;
65 //@}
66 //! \name Visitability
67 //@{
68 void accept(AcyclicVisitor&) override;
69 //@}
70
71 private:
72 ext::shared_ptr<ZeroInflationIndex> zeroInflationIndex_;
76 };
77
78}
79
80#endif
degenerate base class for the Acyclic Visitor pattern
Definition: visitor.hpp:33
Concrete date class.
Definition: date.hpp:125
Cash flow dependent on an index ratio.
virtual Real notional() const
virtual bool growthOnly() const
virtual ext::shared_ptr< Index > index() const
Cash flow dependent on a zero inflation index ratio.
ext::shared_ptr< ZeroInflationIndex > zeroInflationIndex_
CPI::InterpolationType observationInterpolation() const
void accept(AcyclicVisitor &) override
CPI::InterpolationType observationInterpolation_
ext::shared_ptr< ZeroInflationIndex > zeroInflationIndex() const
QL_REAL Real
real number
Definition: types.hpp:50
Cash flow dependent on an index ratio (NOT a coupon, i.e. no accruals)
base classes for inflation indexes
Definition: any.hpp:35
InterpolationType
when you observe an index, how do you interpolate between fixings?