instoptfloat
Create option instrument on floating-rate note or add instrument to current portfolio
Syntax
Description
to specify a European option for a floating-rate note.InstSet
= instoptfloat(FloatIndex
,OptSpec
,Strike
,ExerciseDates
)
to specify an American or Bermuda option for a floating-rate note.InstSet
= instoptfloat(FloatIndex
,OptSpec
,Strike
,ExerciseDates
,AmericanOpt
)
to add instruments to an existing portfolio.InstSet
= instoptfloat(InstSetOld
,___)
[
lists the field metadata for the FieldList
,ClassList
,TypeString
]
= instoptfloat'OptFloat'
instrument.
Examples
Create an Instrument Portfolio with a Call Option for a Floating-Rate Note
Define the floating-rate note:
Settle = datetime(2012,11,1); Maturity = datetime(2015,11,1); Spread = 50; Reset = 1;
Create InstSet
:
InstSet = instfloat(Spread, Settle, Maturity, Reset)
InstSet = struct with fields:
FinObj: 'Instruments'
IndexTable: [1x1 struct]
Type: {'Float'}
FieldName: {{1x1 cell}}
FieldClass: {{1x1 cell}}
FieldData: {{1x1 cell}}
Display the instrument:
instdisp(InstSet)
Index Type Spread Settle Maturity FloatReset Basis Principal EndMonthRule CapRate FloorRate 1 Float 50 01-Nov-2012 01-Nov-2015 1 0 100 1 Inf -Inf
Add a European call option to the instrument portfolio:
OptSpec = 'call'; Strike = 100; ExerciseDates = 'Nov-1-2015';
Create InstSet
:
InstSet = instoptfloat(InstSet, 1, OptSpec, Strike, ExerciseDates)
InstSet = struct with fields:
FinObj: 'Instruments'
IndexTable: [1x1 struct]
Type: {2x1 cell}
FieldName: {2x1 cell}
FieldClass: {2x1 cell}
FieldData: {2x1 cell}
Display the instrument:
instdisp(InstSet)
Index Type Spread Settle Maturity FloatReset Basis Principal EndMonthRule CapRate FloorRate 1 Float 50 01-Nov-2012 01-Nov-2015 1 0 100 1 Inf -Inf Index Type UnderInd OptSpec Strike ExerciseDates AmericanOpt 2 OptFloat 1 call 100 01-Nov-2015 0
Input Arguments
FloatIndex
— Indices pointing to underlying instruments
vector of nonnegative integers
Indices pointing to underlying instruments of Type
'Float'
specified by a
NINST
-by-1
vector. The instruments
of Type
'Float'
are also stored in the InstSet
variable. For more information, see instfloat
.
Data Types: double
OptSpec
— Definition of option
character vector | cell array of character vectors
Definition of option as 'call'
or
'put'
specified as a
NINST
-by-1
cell array of character
vectors for 'call'
or 'put'
.
Data Types: char
| cell
Strike
— Option strike price values for European, Bermuda, or American option
nonnegative integer | vector of nonnegative integers
Option strike price values for option (European, Bermuda, or American)
specified as nonnegative integers using as
NINST
-by-NSTRIKES
vector of strike
price values.
For a European or Bermuda option —
NINST
-by-NSTRIKES
matrix of strike price values. Each row is the schedule for one option. If an option has fewer thanNSTRIKES
exercise opportunities, the end of the row is padded withNaN
s.For an American Option —
NINST
-by-1
vector of strike price values for each option.
Data Types: double
ExerciseDates
— Exercise date for option (European, Bermuda, or American)
datetime array | string array | date character vector
Exercise date for option (European, Bermuda, or American), specified as a
NINST
-by-NSTRIKES
or
NINST
-by-2
vector using a datetime
array, string array, or date character vectors, depending on the option
type.
For a European or Bermuda option —
NINST
-by-NSTRIKES
matrix of exercise dates. Each row is the schedule for one option. For a European option, there is only oneExerciseDate
on the option expiry dateFor an American option —
NINST
-by-2
vector of exercise date boundaries. For each instrument, the option can be exercised on any coupon date between or including the pair of dates on that row. If only one non-NaN
date is listed, or ifExerciseDates
isNINST
-by-1
, the option can be exercised between the underlying bondSettle
date and the single listedExerciseDate
.
To support existing code, instoptfloat
also
accepts serial date numbers as inputs, but they are not recommended.
AmericanOpt
— Option type
0
if AmericanOpt
is
NaN
or not entered (default) | scalar | vector of positive integers[0,1]
Option type specified as NINST
-by-1
positive integer scalar flags with values.
For a European or Bermuda option —
AmericanOpt
is0
for each European or Bermuda option.For an American option —
AmericanOpt
is1
for each American option. TheAmericanOpt
argument is required to invoke American exercise rules.
Data Types: single
| double
InstSetOld
— Variable containing an existing collection of instruments
struct
Variable containing an existing collection of instruments, specified as a
struct. For more information on the InstSet
variable, see
instget
.
Data Types: struct
Output Arguments
InstSet
— Variable containing a collection of instruments
scalar | vector
Variable containing a collection of instruments returned as a scalar or
vector with the instruments broken down by type and each type can have
different data fields. Each stored data field has a row vector or character
vector for each instrument. For more information on the
InstSet
variable, see instget
.
FieldList
— Data field for instrument type
character vector | cell array of character vectors
Data field for instrument type returned as a
NFIELDS
-by-1
cell array of
character vectors listing the name of each data field for this instrument
type.
ClassList
— Data class of each field
character vector with value: 'dble'
,
'date'
, 'char'
| cell array of character vectors with values: 'dble'
,
'date'
, 'char'
Data class of each field returned as
aNFIELDS
-by-1
cell array of
character vectors listing the data class of each field. The class determines
how arguments are parsed.
TypeString
— Type of instrument added
character vector with value 'OptFloat'
Type of instrument added returned as a character vector. The character
vector for a floating-rate option instrument is
TypeString
= 'OptFloat'
.
Version History
Introduced in R2013aR2022b: Serial date numbers not recommended
Although instoptfloat
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.
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)