instlookback
Construct lookback option
Syntax
Description
creates a new instrument set containing Lookback instruments.InstSet
= instlookback(OptSpec
,Strike
,Settle
,ExerciseDates
)
adds an optional argument.InstSet
= instlookback(___,AmericanOpt
)
[
lists field meta-data for the Lookback instrument.FieldList
,ClassList
,TypeString
] = instlookback
Examples
Create a Lookback Option Instrument
Define a floating strike lookback instrument with the following data:
OptSpec = 'call';
Strike = NaN;
Settle = datetime(2012,1,1);
ExerciseDates = datetime(2015,1,1);
Create the instrument set.
InstSet = instlookback(OptSpec, Strike, Settle, ExerciseDates);
Display the lookback instrument.
instdisp(InstSet)
Index Type OptSpec Strike Settle ExerciseDates AmericanOpt 1 Lookback call NaN 01-Jan-2012 01-Jan-2015 0
Input Arguments
InstSet
— Instrument variable
structure
Instrument variable, specified only when adding Lookback instruments to an existing
instrument set. For more information on the InstSet
variable, see
instget
.
Data Types: struct
OptSpec
— Definition of option
character vector with value 'call'
or
'put'
| cell array of character vectors with values 'call'
or
'put'
Definition of option, specified as a scalar 'call'
or
'put'
using a character vector or an
NINST
-by-1
cell array of character vectors for
'call'
or 'put'
.
Data Types: char
| cell
Strike
— Option strike price value
matrix of nonnegative integers
Option strike price value, specified as a scalar nonnegative integer or an
NINST
-by-1
matrix of strike price values. Each
row is the schedule for one option.
Data Types: double
Settle
— Settlement date or trade date
datetime array | string array | date character vector
Settlement date or trade date for the lookback option, specified as a scalar or an
NINST
-by-1
vector using a datetime array, string
array, or date character vectors.
To support existing code, instlookback
also
accepts serial date numbers as inputs, but they are not recommended.
ExerciseDates
— Option exercise dates
datetime array | string array | date character vector
Option exercise dates, specified as a scalar or a
NINST
-by-1
vector using a datetime array, string
array, or date character vectors:
For a European option, use an
NINST
-by-1
vector of exercise dates. Each row is the schedule for one option. For a European option, there is only oneExerciseDates
on the option expiry date.For an American option, use a
NINST
-by-2
vector of exercise date boundaries. The option can be exercised on any tree date between or including the pair of dates on that row. If only one non-NaN
date is listed, or ifExerciseDates
is aNINST
-by-1
vector of dates, the option can be exercised betweenValuationDate
of the stock tree and the single listedExerciseDates
.
To support existing code, instlookback
also
accepts serial date numbers as inputs, but they are not recommended.
AmericanOpt
— Option type
0
European (default) | integer with values 0
or 1
(Optional) Option type, specified as a scalar or an
NINST
-by-1
integer flags with values:
0
— European1
— American
Data Types: 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 Lookback instrument
cell array of character vectors
Name of each data field for a Lookback 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 Lookback instrument,
TypeString = 'Lookback'
.
More About
Lookback Option
A lookback option is a path-dependent option based on the maximum or minimum value the underlying asset achieves during the entire life of the option.
Financial Instruments Toolbox™ software supports two types of lookback options: fixed and floating. Fixed lookback options have a specified strike price, while floating lookback options have a strike price determined by the asset path. For more information, see Lookback Option.
Version History
Introduced before R2006aR2022b: Serial date numbers not recommended
Although instlookback
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 Command
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.
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)