QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
zerocouponinflationswap.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007, 2009 Chris Kenyon
5 Copyright (C) 2009 StatPro Italia srl
6 Copyright (C) 2021 Ralf Konrad Eckel
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20 */
21
26#ifndef quantlib_xxxzciis_hpp
27#define quantlib_xxxzciis_hpp
28
29#include <ql/indexes/inflationindex.hpp>
30#include <ql/instruments/swap.hpp>
31#include <ql/time/calendar.hpp>
32#include <ql/time/daycounter.hpp>
33
34
35namespace QuantLib {
37
69 public:
70 class arguments;
71 class engine;
72
75 const Date& startDate, // start date of contract (only)
76 const Date& maturity, // this is pre-adjustment!
77 Calendar fixCalendar,
78 BusinessDayConvention fixConvention,
81 const ext::shared_ptr<ZeroInflationIndex>& infIndex,
84 bool adjustInfObsDates = false,
85 Calendar infCalendar = Calendar(),
87
89
90
91 Type type() const { return type_; }
92 Real nominal() const { return nominal_; }
93 Date startDate() const override { return startDate_; }
94 Date maturityDate() const override { return maturityDate_; }
97 return fixConvention_;
98 }
99 DayCounter dayCounter() const { return dayCounter_; }
101 Rate fixedRate() const { return fixedRate_; }
102 ext::shared_ptr<ZeroInflationIndex> inflationIndex() const {
103 return infIndex_;
104 }
108 }
112 return infConvention_;
113 }
115 const Leg& fixedLeg() const;
117 const Leg& inflationLeg() const;
119
121
122 Real fixedLegNPV() const;
123 Real inflationLegNPV() const;
124 Real fairRate() const;
126
127 protected:
134 ext::shared_ptr<ZeroInflationIndex> infIndex_;
142 };
143
144
146 public:
148 };
149
150
152 : public GenericEngine<ZeroCouponInflationSwap::arguments,
153 ZeroCouponInflationSwap::results> {};
154
155}
156
157
158#endif
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
template base class for option pricing engines
Interest rate swap.
Definition: swap.hpp:41
Zero-coupon inflation-indexed swap.
Rate fixedRate() const
in the above formula.
ext::shared_ptr< ZeroInflationIndex > inflationIndex() const
CPI::InterpolationType observationInterpolation() const
BusinessDayConvention fixedConvention() const
const Leg & fixedLeg() const
just one cashflow (that is not a coupon) in each leg
BusinessDayConvention inflationConvention() const
ext::shared_ptr< ZeroInflationIndex > infIndex_
Type type() const
"Payer" or "Receiver" refers to the inflation leg
const Leg & inflationLeg() const
just one cashflow (that is not a coupon) in each leg
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Definition: cashflow.hpp:78
InterpolationType
when you observe an index, how do you interpolate between fixings?