QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
instruments
bonds
fixedratebond.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) 2004 Jeff Yu
5
Copyright (C) 2004 M-Dimension Consulting Inc.
6
Copyright (C) 2005 StatPro Italia srl
7
Copyright (C) 2007, 2008, 2010 Ferdinando Ametrano
8
Copyright (C) 2009 Piter Dias
9
10
This file is part of QuantLib, a free-software/open-source library
11
for financial quantitative analysts and developers - http://quantlib.org/
12
13
QuantLib is free software: you can redistribute it and/or modify it
14
under the terms of the QuantLib license. You should have received a
15
copy of the license along with this program; if not, please email
16
<quantlib-dev@lists.sf.net>. The license is also available online at
17
<http://quantlib.org/license.shtml>.
18
19
This program is distributed in the hope that it will be useful, but WITHOUT
20
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21
FOR A PARTICULAR PURPOSE. See the license for more details.
22
*/
23
24
/*! \file fixedratebond.hpp
25
\brief fixed-rate bond
26
*/
27
28
#ifndef quantlib_fixed_rate_bond_hpp
29
#define quantlib_fixed_rate_bond_hpp
30
31
#include <
ql/instruments/bond.hpp
>
32
#include <
ql/time/dategenerationrule.hpp
>
33
#include <
ql/time/daycounter.hpp
>
34
#include <
ql/interestrate.hpp
>
35
36
namespace
QuantLib
{
37
38
class
Schedule;
39
40
//! fixed-rate bond
41
/*! \ingroup instruments
42
43
\test calculations are tested by checking results against
44
cached values.
45
*/
46
class
FixedRateBond
:
public
Bond
{
47
public
:
48
//! simple annual compounding coupon rates
49
FixedRateBond
(
Natural
settlementDays
,
50
Real
faceAmount,
51
Schedule
schedule,
52
const
std::vector<Rate>& coupons,
53
const
DayCounter
& accrualDayCounter,
54
BusinessDayConvention
paymentConvention =
Following
,
55
Real
redemption
= 100.0,
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
const
DayCounter
&
firstPeriodDayCounter
=
DayCounter
());
63
64
Frequency
frequency
()
const
{
return
frequency_
; }
65
const
DayCounter
&
dayCounter
()
const
{
return
dayCounter_
; }
66
const
DayCounter
&
firstPeriodDayCounter
()
const
{
return
firstPeriodDayCounter_
; }
67
protected
:
68
Frequency
frequency_
;
69
DayCounter
dayCounter_
;
70
DayCounter
firstPeriodDayCounter_
;
71
};
72
73
}
74
75
#endif
bond.hpp
concrete bond class
QuantLib::Bond
Base bond class.
Definition:
bond.hpp:59
QuantLib::Bond::settlementDays
Natural settlementDays() const
Definition:
bond.hpp:332
QuantLib::Bond::issueDate
Date issueDate() const
Definition:
bond.hpp:352
QuantLib::Bond::redemption
const ext::shared_ptr< CashFlow > & redemption() const
Definition:
bond.cpp:140
QuantLib::Calendar
calendar class
Definition:
calendar.hpp:61
QuantLib::Date
Concrete date class.
Definition:
date.hpp:125
QuantLib::DayCounter
day counter class
Definition:
daycounter.hpp:44
QuantLib::FixedRateBond
fixed-rate bond
Definition:
fixedratebond.hpp:46
QuantLib::FixedRateBond::dayCounter
const DayCounter & dayCounter() const
Definition:
fixedratebond.hpp:65
QuantLib::FixedRateBond::firstPeriodDayCounter_
DayCounter firstPeriodDayCounter_
Definition:
fixedratebond.hpp:70
QuantLib::FixedRateBond::firstPeriodDayCounter
const DayCounter & firstPeriodDayCounter() const
Definition:
fixedratebond.hpp:66
QuantLib::FixedRateBond::dayCounter_
DayCounter dayCounter_
Definition:
fixedratebond.hpp:69
QuantLib::FixedRateBond::frequency
Frequency frequency() const
Definition:
fixedratebond.hpp:64
QuantLib::FixedRateBond::frequency_
Frequency frequency_
Definition:
fixedratebond.hpp:68
QuantLib::Period
Definition:
period.hpp:44
QuantLib::Schedule
Payment schedule.
Definition:
schedule.hpp:40
dategenerationrule.hpp
date generation rule
daycounter.hpp
day counter class
QuantLib::Frequency
Frequency
Frequency of events.
Definition:
frequency.hpp:37
QuantLib::BusinessDayConvention
BusinessDayConvention
Business Day conventions.
Definition:
businessdayconvention.hpp:41
QuantLib::Unadjusted
@ Unadjusted
Definition:
businessdayconvention.hpp:58
QuantLib::Following
@ Following
Definition:
businessdayconvention.hpp:43
QuantLib::Real
QL_REAL Real
real number
Definition:
types.hpp:50
QuantLib::Natural
unsigned QL_INTEGER Natural
positive integer
Definition:
types.hpp:43
interestrate.hpp
Instrument rate class.
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5