instbond
Construct bond instrument
Syntax
Description
creates a new instrument set containing Bond instruments.InstSet
= instbond(CouponRate
,Settle
,Maturity
)
adds Bond instruments to an existing instrument set.InstSet
= instbond(InstSet
,CouponRate
,Settle
,Maturity
)
adds optional arguments.InstSet
= instbond(___,Period
,Basis
,EndMonthRule
,IssueDate
,FirstCouponDate
,LastCouponDate
,StartDate
,Face
)
[
lists field meta-data for the Bond instrument.FieldList
,ClassList
,TypeString
] = instbond
Examples
Create a Bond Instrument
Create a new instrument variable with the following information:
CouponRate= [0.035;0.04];
Settle= datetime(2013,11,1);
Maturity = datetime(2014,11,1);
Period =1;
InstSet = instbond(CouponRate, Settle, Maturity, ...
Period)
InstSet = struct with fields:
FinObj: 'Instruments'
IndexTable: [1x1 struct]
Type: {'Bond'}
FieldName: {{1x1 cell}}
FieldClass: {{1x1 cell}}
FieldData: {{1x1 cell}}
Display the instrument set.
instdisp(InstSet)
Index Type CouponRate Settle Maturity Period Basis EndMonthRule IssueDate FirstCouponDate LastCouponDate StartDate Face 1 Bond 0.035 01-Nov-2013 01-Nov-2014 1 0 1 NaN NaN NaN NaN 100 2 Bond 0.04 01-Nov-2013 01-Nov-2014 1 0 1 NaN NaN NaN NaN 100
Input Arguments
InstSet
— Instrument variable
structure
Instrument variable, specified only when adding Bond
instruments to an existing instrument set. For more
information on the InstSet
variable, see instget
.
Data Types: struct
CouponRate
— Coupon rate indicating the annual percentage rate
decimal
Coupon rate indicating the annual percentage rate,
specified as an
NINST
-by-1
vector or an
NINST
-by-1
cell array of decimal annual rates, or decimal
annual rate schedules. For the latter case of a
variable coupon schedule, each element of the cell
array is a
NumDates
-by-2
cell array, where the first column is dates and the
second column is its associated rate. The date
indicates the last day that the coupon rate is
valid.
Data Types: double
| cell
Settle
— Settlement dates
datetime array | string array | date character vector
Settlement dates, specified as scalar or an
NINST
-by-1
vector using a datetime array, string array, or date
character vectors.
Note
Settle
must be earlier
than Maturity
.
To support existing code, instbond
also
accepts serial date numbers as inputs, but they are not recommended.
Maturity
— Maturity dates
datetime array | string array | date character vector
Maturity dates, specified as scalar or an
NINST
-by-1
vector using a datetime array, string array, or date
character vectors.
To support existing code, instbond
also
accepts serial date numbers as inputs, but they are not recommended.
Period
— Coupons per year
2
per year (default) | vector
(Optional) Coupons per year, specified as a scalar or
an NINST
-by-1
vector. Values for Period
are
1
, 2
,
3
, 4
,
6
, and
12
.
Data Types: double
Basis
— Day-count basis
0
(actual/actual) (default) | integer from 0
to
13
(Optional) Day-count basis, specified as scalar or an
NINST
-by-1
vector.
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
EndMonthRule
— End-of-month rule flag for generating dates when Maturity
is end-of-month date for
month having 30 or fewer days
1
(in effect) (default) | nonnegative integer [0,1]
(Optional) End-of-month rule flag for generating dates
when Maturity
is an end-of-month
date for a month having 30 or fewer days, specified
as a scalar or a nonnegative integer
[0
, 1
] using
an NINST
-by-1
vector.
0
= Ignore rule, meaning that a bond's coupon payment date is always the same numerical day of the month.1
= Set rule on, meaning that a bond's coupon payment date is always the last actual day of the month.
Data Types: logical
IssueDate
— Bond issue date
datetime array | string array | date character vector
(Optional) Bond issue date, specified as a scalar or
an NINST
-by-1
vector using a datetime array, string array, or date
character vectors.
To support existing code, instbond
also
accepts serial date numbers as inputs, but they are not recommended.
FirstCouponDate
— Irregular first coupon date
datetime array | string array | date character vector
(Optional) Irregular first coupon date, specified as a
scalar or an
NINST
-by-1
vector using a datetime array, string array, or date
character vectors.
To support existing code, instbond
also
accepts serial date numbers as inputs, but they are not recommended.
When FirstCouponDate
and
LastCouponDate
are both
specified, FirstCouponDate
takes
precedence in determining the coupon payment
structure. If you do not specify a
FirstCouponDate
, the cash flow
payment dates are determined from other
inputs.
LastCouponDate
— Irregular last coupon date
datetime array | string array | date character vector
(Optional) Irregular last coupon date, specified as a
scalar or an
NINST
-by-1
vector using a datetime array, string array, or date
character vectors.
To support existing code, instbond
also
accepts serial date numbers as inputs, but they are not recommended.
In the absence of a specified
FirstCouponDate
, a specified
LastCouponDate
determines the
coupon structure of the bond. The coupon structure
of a bond is truncated at the
LastCouponDate
, regardless of
where it falls, and is followed only by the bond's
maturity cash flow date. If you do not specify a
LastCouponDate
, the cash flow
payment dates are determined from other inputs.
StartDate
— Forward starting date of payments
Settle
date (default) | datetime array | string array | date character vector
Forward starting date of payments (the date from which
a bond cash flow is considered), specified as a
scalar or an
NINST
-by-1
vector using a datetime array, string array, or date
character vectors.
To support existing code, instbond
also
accepts serial date numbers as inputs, but they are not recommended.
If you do not specify StartDate
,
the effective start date is the
Settle
date.
Face
— Face value
100
(default) | nonnegative value | cell array of nonnegative values
(Optional) Face or par value, specified as a scalar or
an NINST
-by-1
vector of nonnegative face values or an
NINST
-by-1
cell array of face values or face value schedules.
For the latter case, each element of the cell array
is a
NumDates
-by-2
cell array, where the first column is dates and the
second column is its associated face value. The date
indicates the last day that the face value is
valid.
Data Types: cell
| double
Output Arguments
InstSet
— Variable containing a collection of instruments
structure
Variable containing a collection of instruments,
returned as a structure. Instruments are broken down
by type and each type can have different data
fields. Each stored data field has a row vector or
string for each instrument. For more information on
the InstSet
variable, see
instget
.
FieldList
— Name of each data field for Bond instrument
cell array of character vectors
Name of each data field for a Bond instrument,
returned as an
NFIELDS
-by-1
cell array of character vectors.
ClassList
— Data class for each field
cell array of character vectors
Data class for each field, returned as an
NFIELDS
-by-1
cell array of character vectors. The class
determines how arguments are parsed. Valid character
vectors are 'dble'
,
'date'
, and
'char'
.
TypeString
— Type of instrument
character vector
Type of instrument, returned as a character vector.
For a Bond instrument, TypeString =
'Bond'
.
Version History
Introduced before R2006aR2022b: Serial date numbers not recommended
Although instbond
supports serial date numbers,
datetime
values are recommended instead. The
datetime
data type provides flexible date and time
formats, storage out to nanosecond precision, and properties to account for time
zones and daylight saving time.
To convert serial date numbers or text to datetime
values, use the datetime
function. For example:
t = datetime(738427.656845093,"ConvertFrom","datenum"); y = year(t)
y = 2021
There are no plans to remove support for serial date number inputs.
See Also
hjmprice
| instaddfield
| instdisp
| instget
| intenvprice
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
Select a Web Site
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: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)