FloatBond instrument object
Create and price a FloatBond instrument object using this
workflow:
Use fininstrument
to create a FloatBond instrument object.
Use ratecurve to specify a
curve model for the FloatBond instrument.
Use finpricer to
specify a Discount pricing
method for the FloatBond instrument.
For more 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
FloatBond instrument, see Choose Instruments, Models, and Pricers.
creates a FloatBondObj = fininstrument(InstrumentType,'Spread',spread_value,'Maturity',maturity_date)FloatBond object by specifying
InstrumentType and sets the properties for the
required name-value pair arguments Spread and
Maturity.
The FloatBond instrument supports a vanilla floating
rate note and an amortizing floating rate note. For more information, see
Floating-Rate Note.
sets optional properties using
additional name-value pairs in addition to the required arguments in the
previous syntax. For example, FloatBondObj = fininstrument(___,Name,Value)FloatBondObj =
fininstrument("FloatBond",'Spread',0.6,'Maturity',datetime(2019,1,30),'Basis',1,'Principal',100,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',true,'Name',"float_bond_instrument")
creates a FloatBond instrument with a spread of 0.6 and a
maturity of January 30, 2019. You can specify multiple name-value pair
arguments.
InstrumentType — Instrument type"FloatBond" | character vector with value 'FloatBond'Instrument type, specified as a string with the value of
"FloatBond" or a character vector with the value
of 'FloatBond'.
Data Types: char | string
FloatBond 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.
FloatBondObj =
fininstrument("FloatBond",'Spread',0.6,'Maturity',datetime(2019,1,30),'Basis',1,'Principal',100,'FirstCouponDate',datetime(2016,1,30),'EndMonthRule',true,'Name',"float_bond_instrument")FloatBond Name-Value Pair Arguments'Spread' — Decimal value over the reference rateDecimal value over the reference rate, specified as the
comma-separated pair consisting of 'Spread' and a
scalar nonnegative decimal.
Data Types: double
'Maturity' — Maturity dateMaturity 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
FloatBond Name-Value Pair Arguments'Reset' — Frequency of payments per year2
(default) | integerFrequency of payments per year, specified as the comma-separated
pair consisting of 'Reset' and a scalar integer.
Values for Reset are: 1,
2, 3,
4, 6, or
12.
Data Types: double
'Basis' — Day count basis [0 0] (actual/actual) (default) | integer from 0 to
13Day count basis, specified as the comma-separated pair consisting
of 'Basis' and a 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 | timetableNotional principal 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
'ProjectionCurve' — Rate curve for projecting floating cash flowsratecurve.empty (default) | ratecurve objectRate curve for projecting floating cash flows, specified as the
comma-separated pair consisting of
'ProjectionCurve' and a
ratecurve object. You must create this object
using ratecurve.
Data Types: object
'ResetOffset' — Lag in rate setting0 (default) | numericLag in rate setting, specified as the comma-separated pair
consisting of 'ResetOffset' and a scalar
numeric.
Data Types: double
'LatestFloatingRate' — Latest floating rate[]
(default) | decimalLatest floating rate for the FloatBond object,
specified as the comma-separated pair consisting of
'LatestFloatingRate' and a scalar
decimal.
Data Types: double
'DaycountAdjustedCashFlow' — Flag to adjust cash flows based on actual period day countfalse
(default) | value of true or
falseFlag to adjust cash flows based on actual period day count,
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"actual"
(default) | string | character vectorBusiness day conventions, 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 date 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));
FloatBondObj = fininstrument("floatbond",'Spread',100,'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) | logical true or
falseEnd-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 | character vector | date stringForward starting date of payments, specified as the
comma-separated pair consisting of 'StartDate'
and a scalar datetime, serial date number, 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
Spread — Number of basis points over the reference rateNumber of basis points over the reference rate, returned as a scalar nonnegative numeric.
Data Types: double
Maturity — Maturity dateMaturity date, returned as a datetime.
Data Types: datetime
Reset — Frequency of payment per year1 (default) | integerCoupons per year, returned as a scalar integer.
Data Types: double
Basis — Day count basis 0 (actual/actual) (default) | integer from 0 to 13Day count basis, returned as a scalar integer.
Data Types: double
Principal — Notional principal amount or principal value schedules100
(default) | scalar numeric | timetableNotional principal amount or principal value schedules, returned as a scalar numeric or timetable.
Data Types: timetable | double
ProjectionCurve — Rate curve used in generating future cash flowsratecurve.empty (default) | ratecurve objectRate curve to be used in projecting the future cash flows, returned as a
ratecurve object.
Data Types: object
ResetOffset — Lag in rate setting0 (default) | numericLag in rate setting, returned as a scalar numeric.
Data Types: double
LatestFloatingRate — Latest floating rate for FloatBond[ ]
(default) | decimalLatest floating rate for FloatBond, returned as a
scalar decimal.
Data Types: double
DaycountAdjustedCashFlow — Flag to adjust cash flows based on actual period day countfalse
(default) | value of true or falseFlag to adjust cash flows based on actual period day count, 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) | logical with value of true or
falseEnd-of-month rule flag for generating dates when
Maturity is an end-of-month date for a month with 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 FloatBond instrument when you use a ratecurve and a Discount pricing method.
Create FloatBond Instrument Object
Use fininstrument to create a vanilla FloatBond instrument object.
FloatB = fininstrument("FloatBond",'Maturity',datetime(2022,9,15),'Spread',0.025,'Reset',2,'Basis',1,'Principal',100,'EndMonthRule',false,'Name',"float_bond_instrument")
FloatB =
FloatBond with properties:
Spread: 0.0250
ProjectionCurve: [0x0 ratecurve]
ResetOffset: 0
Reset: 2
Basis: 1
EndMonthRule: 0
Principal: 100
DaycountAdjustedCashFlow: 0
BusinessDayConvention: "actual"
LatestFloatingRate: NaN
Holidays: NaT
IssueDate: NaT
FirstCouponDate: NaT
LastCouponDate: NaT
StartDate: NaT
Maturity: 15-Sep-2022
Name: "float_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 for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("Discount",'DiscountCurve',myRC)
outPricer =
Discount with properties:
DiscountCurve: [1x1 ratecurve]
Price FloatBond Instrument
Use price to compute the price and sensitivities for the vanilla FloatBond instrument.
[Price, outPR] = price(outPricer, FloatB,["all"])Price = 109.8322
outPR =
priceresult with properties:
Results: [1x2 table]
PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ ________
109.83 0.021976
ratecurve and Discount PricerThis example shows the workflow to price an amortizing FloatBond instrument when you use a ratecurve and a Discount pricing method.
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 FloatBond Instrument Object
Use fininstrument to create an amortizing FloatdBond instrument object.
Maturity = datetime(2024,1,1); Spread = 0.02; Reset = 1; ADates = datetime([2020,1,1 ; 2024,1,1]); APrincipal = [100; 80]; Principal = timetable(ADates,APrincipal); Floatamort = fininstrument("FloatBond",'Maturity',Maturity,'Spread',Spread,'Reset',Reset,'ProjectionCurve',ZeroCurve,'Principal',Principal)
Floatamort =
FloatBond with properties:
Spread: 0.0200
ProjectionCurve: [1x1 ratecurve]
ResetOffset: 0
Reset: 1
Basis: 0
EndMonthRule: 1
Principal: [2x1 timetable]
DaycountAdjustedCashFlow: 0
BusinessDayConvention: "actual"
LatestFloatingRate: NaN
Holidays: NaT
IssueDate: NaT
FirstCouponDate: NaT
LastCouponDate: NaT
StartDate: NaT
Maturity: 01-Jan-2024
Name: ""
Create Discount Pricer Object
Use finpricer to create an 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 FloatBond Instrument
Use price to compute the price and sensitivities for the vanilla FloatBond instrument.
[Price, outPR] = price(outPricer,Floatamort,["all"])Price = 110.1101
outPR =
priceresult with properties:
Results: [1x2 table]
PricerData: []
outPR.Results
ans=1×2 table
Price DV01
______ ________
110.11 0.028613
A floating-rate note is a security like a bond, but the interest rate of the note is reset periodically, relative to a reference index rate, to reflect fluctuations in market interest rates.
You have a modified version of this example. Do you want to open this example with your edits?