FixedBond
instrument object
Create and price a FixedBond
instrument object using this
workflow:
Use fininstrument
to create a FixedBond
instrument object.
Use ratecurve
to specify a
curve model for the FixedBond
instrument.
Use finpricer
to
specify a Discount
pricing
method for the FixedBond
instrument.
For more detailed information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
For more information on the available models and pricing methods for a
FixedBond
instrument, see Choose Instruments, Models, and Pricers.
creates a FixedBondObj
= fininstrument(InstrumentType
,'CouponRate
',couponrate_value,'Maturity
',maturity_date)FixedBond
object by specifying
InstrumentType
and sets the properties for the
required name-value pair arguments CouponRate
and
Maturity
.
The FixedBond
instrument supports a vanilla bond, a
stepped coupon bond, and an amortizing bond. For more information, see More About.
sets optional properties using
additional name-value pairs in addition to the required arguments in the
previous syntax. For example, FixedBondObj
= fininstrument(___,Name,Value
)FixedBondObj =
fininstrument("FixedBond",'CouponRate',0.034,'Maturity',datetime(2019,1,30),'Period',4,'Basis',1,'Principal',100,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',true,'Name',"fixedbond_instrument")
creates a FixedBond
option with a coupon rate of 0.34 and
a maturity of January 30, 2019. You can specify multiple name-value pair
arguments.
InstrumentType
— Instrument type"Fixedbond"
| character vector with value 'FixedBond'
Instrument type, specified as a string with the value of
"FixedBond"
or a character vector with a value of
'FixedBond'
.
Data Types: char
| string
FixedBond
Name-Value Pair ArgumentsSpecify required
and optional comma-separated pairs of Name,Value
arguments.
Name
is the argument name and Value
is
the corresponding value. Name
must appear inside quotes. You
can specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
FixedBondObj =
fininstrument("FixedBond",'CouponRate',0.034,'Maturity',datetime(2019,1,30),'Period',4,'Basis',1,'Principal',100,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',true,'Name',"fixedbond_instrument")
FixedBond
Name-Value Pair Arguments'CouponRate'
— FixedBond
coupon rateFixedBond
coupon rate, specified as the
comma-separated pair consisting of 'CouponRate'
and a scalar decimal for an annual rate or a timetable where the
first column is dates and the second column is associated rates. The
date indicates the last day that the coupon rate is valid.
Data Types: double
| timetable
'Maturity'
— FixedBond
maturity dateFixedBond
maturity date, specified as the
comma-separated pair consisting of 'Maturity'
and
a scalar datetime, serial date number, date character vector, or
date string.
If you use a date character vector or date string, the format must
be recognizable by datetime
because
the Maturity
property is stored as a
datetime.
Data Types: char
| double
| string
| datetime
FixedBond
Name-Value Pair Arguments'Period'
— Frequency of payments per year2
(default) | numeric value of 0
, 1
,
2
, 3
,
4
, 6
, or
12
Frequency of payments, specified as the comma-separated pair
consisting of 'Period'
and a scalar integer.
Values for Period
are: 1
,
2
, 3
,
4
, 6
, or
12
.
Data Types: double
'Basis'
— Day count basis 0
(actual/actual) (default) | integer from 0
to
13
Day count basis, specified as the comma-separated pair consisting
of 'Basis'
and scalar integer using one of the
following values:
0 — actual/actual
1 — 30/360 (SIA)
2 — actual/360
3 — actual/365
4 — 30/360 (PSA)
5 — 30/360 (ISDA)
6 — 30/360 (European)
7 — actual/365 (Japanese)
8 — actual/actual (ICMA)
9 — actual/360 (ICMA)
10 — actual/365 (ICMA)
11 — 30/360E (ICMA)
12 — actual/365 (ISDA)
13 — BUS/252
For more information, see Basis.
Data Types: double
'Principal'
— Principal amount or principal value schedule100
(default) | scalar numeric | timetablePrincipal amount or principal value schedule, specified as the
comma-separated pair consisting of 'Principal'
and a scalar numeric or timetable.
Principal
accepts a timetable
, where the
first column is dates and the second column is the associated
notional principal value. The date indicates the last day that the
principal value is valid.
Data Types: double
| timetable
'DaycountAdjustedCashFlow'
— Flag indicating whether cash flow adjusts for day count conventionfalse
(default) | value of true
or
false
Flag indicating whether cash flow is adjusted by day count
convention, specified as the comma-separated pair consisting of
'DaycountAdjustedCashFlow'
and a scalar
logical with a value of true
or
false
.
Data Types: logical
'BusinessDayConvention'
— Business day conventions for cash flow dates"actual"
(default) | string | character vectorBusiness day conventions for cash flow
dates, specified as the comma-separated pair consisting of
'BusinessDayConvention'
and a scalar string
or character vector. The selection for business day convention
determines how nonbusiness days are treated. Nonbusiness days are
defined as weekends plus any other date that businesses are not open
(for example, statutory holidays). Values are:
"actual"
— Nonbusiness days
are effectively ignored. Cash flows that fall on
nonbusiness days are assumed to be distributed on the
actual date.
"follow"
— Cash flows that
fall on a nonbusiness day are assumed to be distributed
on the following business day.
"modifiedfollow"
— Cash
flows that fall on a nonbusiness day are assumed to be
distributed on the following business day. However if
the following business day is in a different month, the
previous business day is adopted instead.
"previous"
— Cash flows that
fall on a nonbusiness day are assumed to be distributed
on the previous business day.
"modifiedprevious"
— Cash
flows that fall on a nonbusiness day are assumed to be
distributed on the previous business day. However if the
previous business day is in a different month, the
following business day is adopted instead.
Data Types: char
| string
'Holidays'
— Holidays used in computing business daysNaT
(default) | datetime | cell array of character vectors | date string array | serial date numbersHolidays used in computing business days, specified as the
comma-separated pair consisting of 'Holidays'
and
dates using datetimes, serial date numbers, cell array of date
character vectors, or date string array. For
example:
H = holidays(datetime('today'),datetime(2025,12,15)); FixedBondObj = fininstrument("FixedBond",'CouponRate',0.34,'Maturity',datetime(2025,12,15),'Holidays',H)
Data Types: double
| cell
| datetime
| string
'EndMonthRule'
— End-of-month rule flag for generating dates when Maturity
is end-of-month date for month with 30
or fewer daystrue
(in effect) (default) | value of true
or
false
End-of-month rule flag for generating dates when
Maturity
is an end-of-month date for a month
with 30 or fewer days, specified as the comma-separated pair
consisting of 'EndMonthRule'
and a scalar logical
value of true
or false
.
If you set EndMonthRule
to
false
, the software ignores the
rule, meaning that a payment date is always the same
numerical day of the month.
If you set EndMonthRule
to
true
, the software sets the rule
on, meaning that a payment date is always the last
actual day of the month.
Data Types: logical
'IssueDate'
— Bond issue dateNaT
(default) | datetime | serial date number | date character vector | date stringBond issue date, specified as the comma-separated pair consisting
of 'IssueDate'
and a scalar datetime, serial date
number, date character vector, or date string.
If you use a date character vector or date string, the format must
be recognizable by datetime
because
the IssueDate
property is stored as a
datetime.
Data Types: double
| char
| string
| datetime
'FirstCouponDate'
— Irregular first coupon dateNaT
(default) | datetime | serial date number | date character vector | date stringIrregular first coupon date, specified as the comma-separated pair
consisting of 'FirstCouponDate'
and a scalar
datetime, serial date number, date character vector, or date
string.
When FirstCouponDate
and
LastCouponDate
are both specified,
FirstCouponDate
takes precedence in
determining the coupon payment structure. If you do not specify
FirstCouponDate
, the cash flow payment dates
are determined from other inputs.
If you use a date character vector or date string, the format must
be recognizable by datetime
because
the FirstCouponDate
property is stored as a
datetime.
Data Types: double
| char
| string
| datetime
'LastCouponDate'
— Irregular last coupon dateNaT
(default) | datetime | serial date number | date character vector | date stringIrregular last coupon date, specified as the comma-separated pair
consisting of 'LastCouponDate'
and a scalar
datetime, serial date number, date character vector, or date
string.
If you specify LastCouponDate
but not
FirstCouponDate
,
LastCouponDate
determines the coupon
structure of the bond. The coupon structure of a bond is truncated
at LastCouponDate
, regardless of where it falls,
and is followed only by the bond's maturity cash flow date. If you
do not specify LastCouponDate
, the cash flow
payment dates are determined from other inputs.
If you use a date character vector or date string, the format must
be recognizable by datetime
because
the LastCouponDate
property is stored as a
datetime.
Data Types: double
| char
| string
| datetime
'StartDate'
— Forward starting date of paymentsNaT
(default) | datetime | serial date number | date character vector | date stringForward starting date of payments, specified as the
comma-separated pair consisting of 'StartDate'
and a scalar datetime, serial date number, date character vector, or
date string.
If you use a date character vector or date string, the format must
be recognizable by datetime
because
the StartDate
property is stored as a
datetime.
Data Types: char
| double
| string
| datetime
'Name'
— User-defined name for instrument" "
(default) | string | character vectorUser-defined name for the instrument, specified as the
comma-separated pair consisting of 'Name'
and a
scalar string or character vector.
Data Types: char
| string
CouponRate
— FixedBond
coupon annual rateFixedBond
coupon annual rate, returned as a scalar
decimal or timetable.
Data Types: double
| timetable
Maturity
— FixedBond
maturity dateFixedBond
maturity date, returned as a datetime.
Data Types: datetime
Period
— Frequency of payments per year2
(default) | integerFrequency of payments per year, returned as a scalar integer.
Data Types: double
Basis
— Day count basis 0
(actual/actual) (default) | integer from 0
to 13
Day count basis, returned as a scalar integer.
Data Types: double
Principal
— Principal amount or principal value schedules100
(default) | scalar numeric | timetablePrincipal amount or principal value schedules, returned as a scalar numeric or timetable.
Data Types: double
DaycountAdjustedCashFlow
— Flag indicating whether cash flow adjusts for day count conventionfalse
(default) | value of true
or false
Flag indicating whether cash flow adjusts for day count convention,
returned as scalar logical with a value of true
or
false
.
Data Types: logical
BusinessDayConvention
— Business day conventions"actual"
(default) | stringBusiness day conventions, returned as a string
Data Types: string
Holidays
— Holidays used in computing business daysNaT
(default) | datetimeHolidays used in computing business days, returned as datetimes.
Data Types: datetime
EndMonthRule
— End-of-month rule flag for generating dates when Maturity
is end-of-month date for month with 30 or fewer
daystrue
(in effect) (default) | value of true
or false
End-of-month rule flag for generating dates when
Maturity
is an end-of-month date for a month having
30 or fewer days, returned as a scalar logical.
Data Types: logical
IssueDate
— Bond issue dateNaT
(default) | datetimeBond issue date, returned as a datetime.
Data Types: datetime
FirstCouponDate
— Irregular first coupon dateNaT
(default) | datetimeIrregular first coupon date, returned as a datetime.
Data Types: datetime
LastCouponDate
— Irregular last coupon dateNaT
(default) | datetimeIrregular last coupon date, returned as a datetime.
Data Types: datetime
StartDate
— Forward starting date of paymentsNaT
(default) | datetimeForward starting date of payments, returned as a datetime.
Data Types: datetime
Name
— User-defined name for instrument" "
(default) | stringUser-defined name for the instrument, returned as a string.
Data Types: string
cashflows | Computes cash flow for FixedBond , FloatBond ,
Swap , FRA , or Deposit
instrument |
ratecurve
and Discount PricerThis example shows the workflow to price a vanilla FixedBond
instrument when you use a ratecurve
and a Discount
pricing method.
Create FixedBond
Instrument Object
Use fininstrument
to create a FixedBond
instrument object.
FixB = fininstrument("FixedBond",'Maturity',datetime(2022,9,15),'CouponRate',0.021,'Period',2,'Basis',1,'Principal',100,'Name',"fixed_bond_instrument")
FixB = FixedBond with properties: CouponRate: 0.0210 Period: 2 Basis: 1 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 15-Sep-2022 Name: "fixed_bond_instrument"
Create ratecurve
Object
Create a ratecurve
object using ratecurve
.
Settle = datetime(2018,9,15); Type = 'zero'; ZeroTimes = [calmonths(6) calyears([1 2 3 4 5 7 10 20 30])]'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; myRC = ratecurve('zero',Settle,ZeroDates,ZeroRates)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 0 Dates: [10x1 datetime] Rates: [10x1 double] Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create Discount
Pricer Object
Use finpricer
to create a Discount
pricer object and use the ratecurve
object with the 'DiscountCurve'
name-value pair argument.
outPricer = finpricer("Discount",'DiscountCurve',myRC)
outPricer = Discount with properties: DiscountCurve: [1x1 ratecurve]
Price FixedBond
Instrument
Use price
to compute the price and sensitivities for the FixedBond
instrument.
[Price, outPR] = price(outPricer, FixB,["all"])
Price = 104.5679
outPR = priceresult with properties: Results: [1x2 table] PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ ________
104.57 0.040397
ratecurve
and Discount PricerThis example shows the workflow to price a stepped FixedBond
instrument when you use a ratecurve
and a Discount
pricing method.
Create FixedBond
Instrument Object
Use fininstrument
to create a stepped FixedBond
instrument object.
Maturity = datetime(2024,1,1); Period = 1; CDates = datetime([2020,1,1 ; 2024,1,1]); CRates = [.025; .03]; CouponRate = timetable(CDates,CRates); SBond = fininstrument("FixedBond",'Maturity',Maturity,'CouponRate',CouponRate,'Period',Period)
SBond = FixedBond with properties: CouponRate: [2x1 timetable] Period: 1 Basis: 0 EndMonthRule: 1 Principal: 100 DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 01-Jan-2024 Name: ""
Create ratecurve
Object
Create a ratecurve
object using ratecurve
.
Settle = datetime(2018,1,1); ZeroTimes = calyears(1:10)'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; Compounding = 1; ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates, "Compounding",Compounding)
ZeroCurve = ratecurve with properties: Type: "zero" Compounding: 1 Basis: 0 Dates: [10x1 datetime] Rates: [10x1 double] Settle: 01-Jan-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
Create Discount
Pricer Object
Use finpricer
to create a Discount
pricer object and use the ratecurve
object with the 'DiscountCurve'
name-value pair argument.
outPricer = finpricer("Discount",'DiscountCurve',ZeroCurve)
outPricer = Discount with properties: DiscountCurve: [1x1 ratecurve]
Price FixedBond
Instrument
Use price
to compute the price and sensitivities for the vanilla FixedBond
instrument.
[Price, outPR] = price(outPricer, SBond,["all"])
Price = 109.6218
outPR = priceresult with properties: Results: [1x2 table] PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ ________
109.62 0.061108
ratecurve
and Discount PricerThis example shows the workflow to price a amortizing FixedBond
instrument when you use a ratecurve
and a Discount
pricing method.
Create FixedBond
Instrument Object
Use fininstrument
to create a amortizing FixedBond
instrument object.
Maturity = datetime(2024,1,1); Period = 1; ADates = datetime([2020,1,1 ; 2024,1,1]); APrincipal = [100; 85]; Principal = timetable(ADates,APrincipal); Bondamort = fininstrument("FixedBond",'Maturity',Maturity,'CouponRate',0.025,'Period',Period,'Principal',Principal)
Bondamort = FixedBond with properties: CouponRate: 0.0250 Period: 1 Basis: 0 EndMonthRule: 1 Principal: [2x1 timetable] DaycountAdjustedCashFlow: 0 BusinessDayConvention: "actual" Holidays: NaT IssueDate: NaT FirstCouponDate: NaT LastCouponDate: NaT StartDate: NaT Maturity: 01-Jan-2024 Name: ""
Create ratecurve
Object
Create a ratecurve
object using ratecurve
.
Settle = datetime(2018,1,1); ZeroTimes = calyears(1:10)'; ZeroRates = [0.0052 0.0055 0.0061 0.0073 0.0094 0.0119 0.0168 0.0222 0.0293 0.0307]'; ZeroDates = Settle + ZeroTimes; Compounding = 1; ZeroCurve = ratecurve("zero",Settle,ZeroDates,ZeroRates, "Compounding",Compounding);
Create Discount
Pricer Object
Use finpricer
to create a Discount
pricer object and use the ratecurve
object for the 'DiscountCurve'
name-value pair argument.
outPricer = finpricer("Discount",'DiscountCurve',ZeroCurve)
outPricer = Discount with properties: DiscountCurve: [1x1 ratecurve]
Price FixedBond
Instrument
Use price
to compute the price and sensitivities for the vanilla FixedBond
instrument.
[Price, outPR] = price(outPricer,Bondamort,["all"])
Price = 107.1273
outPR = priceresult with properties: Results: [1x2 table] PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ ________
107.13 0.054279
A fixed-rate note is a long-term debt security with a preset interest rate and maturity, by which the interest must be paid.
The principal might or might not be paid at maturity. In Financial Instruments Toolbox™, the principal is always paid at maturity. For more information, see Fixed-Rate Note.
A vanilla coupon bond is a security representing an obligation to repay a borrowed amount at a designated time and to make periodic interest payments until that time.
The issuer of a bond makes the periodic interest payments until the bond matures. At maturity, the issuer pays to the holder of the bond the principal amount owed (face value) and the last interest payment.
A step-up bond and a step-down bond are debt securities with a predetermined coupon structure over time.
With these instruments, coupons increase (step up) or decrease (step down) at specific times during the life of the bond.
An amortized bond is treated as an asset, with the discount amount being amortized to interest expense over the life of the bond.
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.