QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
cpibond.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2010, 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
24#ifndef quantlib_cpibond_hpp
25#define quantlib_cpibond_hpp
26
27
28#include <ql/instruments/bond.hpp>
29#include <ql/time/dategenerationrule.hpp>
30#include <ql/time/daycounter.hpp>
31#include <ql/interestrate.hpp>
32#include <ql/cashflows/cpicoupon.hpp>
33
34namespace QuantLib {
35
36 class Schedule;
37
40
43 class CPIBond : public Bond {
44 public:
46 Real faceAmount,
47 bool growthOnly,
50 ext::shared_ptr<ZeroInflationIndex> cpiIndex,
52 const Schedule& schedule,
53 const std::vector<Rate>& coupons,
54 const DayCounter& accrualDayCounter,
55 BusinessDayConvention paymentConvention = ModifiedFollowing,
56 const Date& issueDate = Date(),
57 const Calendar& paymentCalendar = Calendar(),
58 const Period& exCouponPeriod = Period(),
59 const Calendar& exCouponCalendar = Calendar(),
60 BusinessDayConvention exCouponConvention = Unadjusted,
61 bool exCouponEndOfMonth = false);
62
63 Frequency frequency() const { return frequency_; }
64 const DayCounter& dayCounter() const { return dayCounter_; }
65 bool growthOnly() const { return growthOnly_; }
66 Real baseCPI() const { return baseCPI_; }
68 const ext::shared_ptr<ZeroInflationIndex>& cpiIndex() const { return cpiIndex_; }
70
71 protected:
77 ext::shared_ptr<ZeroInflationIndex> cpiIndex_;
79 };
80
81
82}
83
84
85
86
87
88
89#endif
Base bond class.
Definition: bond.hpp:59
Natural settlementDays() const
Definition: bond.hpp:318
Date issueDate() const
Definition: bond.hpp:338
Period observationLag_
Definition: cpibond.hpp:76
ext::shared_ptr< ZeroInflationIndex > cpiIndex_
Definition: cpibond.hpp:77
bool growthOnly() const
Definition: cpibond.hpp:65
const DayCounter & dayCounter() const
Definition: cpibond.hpp:64
CPI::InterpolationType observationInterpolation() const
Definition: cpibond.hpp:69
DayCounter dayCounter_
Definition: cpibond.hpp:73
Period observationLag() const
Definition: cpibond.hpp:67
CPI::InterpolationType observationInterpolation_
Definition: cpibond.hpp:78
const ext::shared_ptr< ZeroInflationIndex > & cpiIndex() const
Definition: cpibond.hpp:68
Frequency frequency() const
Definition: cpibond.hpp:63
Frequency frequency_
Definition: cpibond.hpp:72
Real baseCPI() const
Definition: cpibond.hpp:66
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Payment schedule.
Definition: schedule.hpp:40
Frequency
Frequency of events.
Definition: frequency.hpp:37
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Definition: any.hpp:35
InterpolationType
when you observe an index, how do you interpolate between fixings?