QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
convertiblebonds.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2005, 2006 Theo Boafo
5 Copyright (C) 2006, 2007 StatPro Italia srl
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
25#ifndef quantlib_convertible_bonds_hpp
26#define quantlib_convertible_bonds_hpp
27
28#include <ql/instruments/bond.hpp>
29#include <ql/instruments/callabilityschedule.hpp>
30#include <ql/instruments/dividendschedule.hpp>
31#include <ql/instruments/oneassetoption.hpp>
32#include <ql/quote.hpp>
33#include <ql/time/daycounter.hpp>
34#include <ql/time/schedule.hpp>
35
36namespace QuantLib {
37
38 class IborIndex;
39 class PricingEngine;
40
43 public:
46 Real trigger() const { return trigger_; }
47
48 private:
50 };
51
52
54 class ConvertibleBond : public Bond {
55 public:
56 class arguments;
57 class engine;
59 const CallabilitySchedule& callability() const { return callability_; }
60
61 protected:
62 ConvertibleBond(ext::shared_ptr<Exercise> exercise,
65 const Date& issueDate,
67 const Schedule& schedule,
69 void setupArguments(PricingEngine::arguments*) const override;
70
71 private:
72 ext::shared_ptr<Exercise> exercise_;
76 };
77
78
80
86 public:
87 ConvertibleZeroCouponBond(const ext::shared_ptr<Exercise>& exercise,
90 const Date& issueDate,
92 const DayCounter& dayCounter,
93 const Schedule& schedule,
94 Real redemption = 100);
95 };
96
97
99
105 public:
106 ConvertibleFixedCouponBond(const ext::shared_ptr<Exercise>& exercise,
109 const Date& issueDate,
111 const std::vector<Rate>& coupons,
112 const DayCounter& dayCounter,
113 const Schedule& schedule,
114 Real redemption = 100,
115 const Period& exCouponPeriod = Period(),
116 const Calendar& exCouponCalendar = Calendar(),
117 BusinessDayConvention exCouponConvention = Unadjusted,
118 bool exCouponEndOfMonth = false);
119 };
120
121
123
129 public:
130 ConvertibleFloatingRateBond(const ext::shared_ptr<Exercise>& exercise,
133 const Date& issueDate,
135 const ext::shared_ptr<IborIndex>& index,
136 Natural fixingDays,
137 const std::vector<Spread>& spreads,
138 const DayCounter& dayCounter,
139 const Schedule& schedule,
140 Real redemption = 100,
141 const Period& exCouponPeriod = Period(),
142 const Calendar& exCouponCalendar = Calendar(),
143 BusinessDayConvention exCouponConvention = Unadjusted,
144 bool exCouponEndOfMonth = false);
145 };
146
147
149 public:
152
153 ext::shared_ptr<Exercise> exercise;
155 std::vector<Date> callabilityDates;
156 std::vector<Callability::Type> callabilityTypes;
157 std::vector<Real> callabilityPrices;
158 std::vector<Real> callabilityTriggers;
162
165 void validate() const override;
166 };
167
169 : public GenericEngine<ConvertibleBond::arguments, ConvertibleBond::results> {};
170
171}
172
173#endif
Bond price information.
Definition: bond.hpp:62
Base bond class.
Definition: bond.hpp:59
Natural settlementDays() const
Definition: bond.hpp:318
Date issueDate() const
Definition: bond.hpp:338
const ext::shared_ptr< CashFlow > & redemption() const
Definition: bond.cpp:140
calendar class
Definition: calendar.hpp:61
instrument callability
Date date() const override
returns the date at which the event occurs
const Bond::Price & price() const
ext::shared_ptr< Exercise > exercise
std::vector< Callability::Type > callabilityTypes
base class for convertible bonds
void setupArguments(PricingEngine::arguments *) const override
const CallabilitySchedule & callability() const
ext::shared_ptr< Exercise > exercise_
CallabilitySchedule callability_
convertible fixed-coupon bond
convertible floating-rate bond
convertible zero-coupon bond
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
template base class for option pricing engines
template class providing a null value for a given type.
Definition: null.hpp:76
Payment schedule.
Definition: schedule.hpp:40
callability leaving to the holder the possibility to convert
SoftCallability(const Bond::Price &price, const Date &date, Real trigger)
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
std::vector< ext::shared_ptr< Callability > > CallabilitySchedule
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
Definition: cashflow.hpp:78