compoundbycrr
Price compound option from Cox-Ross-Rubinstein binomial tree
Syntax
Description
[
prices
compound options from a Cox-Ross-Rubinstein binomial tree.Price
,PriceTree
]
= compoundbycrr(CRRTree
,UOptSpec
,UStrike
,USettle
,UExerciseDates
,UAmericanOpt
,COptSpec
,CStrike
,CSettle
,CExerciseDates
)
[
adds
an optional argument for Price
,PriceTree
]
= compoundbycrr(___,CAmericanOpt
)CAmericanOpt
.
Examples
Price a Compound Option Using a CRR Binomial Tree
This example shows how to price a compound option using a CRR binomial tree by loading the file deriv.mat
, which provides CRRTree
. The CRRTree
structure contains the stock specification and time information needed to price the option.
load deriv.mat UOptSpec = 'Call'; UStrike = 130; USettle = datetime(2003,1,1); UExerciseDates = datetime(2006,1,1); UAmericanOpt = 1; COptSpec = 'Put'; CStrike = 5; CSettle = datetime(2003,1,1); CExerciseDates = datetime(2005,1,1); Price = compoundbycrr(CRRTree, UOptSpec, UStrike, USettle, ... UExerciseDates, UAmericanOpt, COptSpec, CStrike, CSettle, ... CExerciseDates)
Price = 2.8482
Input Arguments
CRRTree
— Stock tree structure
structure
Stock tree structure, specified by using crrtree
.
Data Types: struct
UOptSpec
— Definition of underlying option
character vector with value 'call'
or 'put'
Definition of underlying option, specified as 'call'
or 'put'
using
a character vector.
Data Types: char
UStrike
— Underlying option strike price value
nonnegative integer
Underlying option strike price value, specified with a nonnegative
integer using a 1
-by-1
vector.
Data Types: double
USettle
— Underlying option settlement date or trade date
datetime array | string array | date character vector
Underlying option settlement date or trade date, specified as a
1
-by-1
vector using a datetime
array, string array, or date character vectors.
To support existing code, compoundbycrr
also
accepts serial date numbers as inputs, but they are not recommended.
UExerciseDates
— Underlying option exercise date
datetime array | string array | date character vector
Underlying option exercise date, specified as a datetime array, string array, or date character vectors:
For a European option, use a
1
-by-1
vector of the underlying exercise date. For a European option, there is only oneExerciseDates
on the option expiry date.For an American option, use a
1
-by-2
vector of the underlying exercise date boundaries. The option can be exercised on any tree date. If only one non-NaN
date is listed, or ifExerciseDates
is1
-by-1
, the option can be exercised betweenValuationDate
of the stock tree and the single listedExerciseDates
.
To support existing code, compoundbycrr
also
accepts serial date numbers as inputs, but they are not recommended.
UAmericanOpt
— Underlying option type
0
European (default) | scalar with values 0
or 1
Underlying option type, specified as NINST
-by-1
positive
integer scalar flags with values:
0
— European1
— American
If UAmericanOpt
is a NaN
or
is unspecified, the option is a European option.
Data Types: double
COptSpec
— Definition of compound option
character vector with value 'call'
or 'put'
| cell array of character vectors with values 'call'
or 'put'
Definition of compound option, specified as 'call'
or 'put'
using
a character vector or a cell array of character vectors with values 'call'
or 'put'
.
Data Types: char
| cell
CStrike
— Compound option strike price values
nonnegative integers
Compound option strike price values for a European and American
option, specified with a nonnegative integer using a NINST
-by-1
matrix.
Each row is the schedule for one option.
Data Types: double
CSettle
— Compound option settlement date or trade date
datetime array | string array | date character vector
Compound option settlement date or trade date, specified as a
1
-by-1
vector using a datetime
array, string array, or date character vectors.
To support existing code, compoundbycrr
also
accepts serial date numbers as inputs, but they are not recommended.
CExerciseDates
— Compound option exercise dates
datetime array | string array | date character vector
Compound option exercise dates, specified as a datetime array, string array, or date character vectors:
For a European option, use a
NINST
-by-1
matrix of the compound 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 the compound exercise date boundaries. For each instrument, 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
isNINST
-by-1
, the option can be exercised betweenValuationDate
of the stock tree and the single listedExerciseDates
.
To support existing code, compoundbycrr
also
accepts serial date numbers as inputs, but they are not recommended.
CAmericanOpt
— Compound option type
0
European (default) | scalar with values 0
or 1
(Optional) Compound option type, specified as NINST
-by-1
positive
integer scalar flags with values:
0
— European1
— American
If CAmericanOpt
is a NaN
or
is unspecified, the option is a European option.
Data Types: double
Output Arguments
Price
— Expected prices for compound options at time 0
vector
Expected prices for compound options at time 0, returned as
a NINST
-by-1
vector.
PriceTree
— Structure with vector of compound option prices at each node
tree structure
Structure with a vector of compound option prices at each node, returned as a tree structure.
PriceTree
is a MATLAB® structure of trees
containing vectors of instrument prices and a vector of observation
times for each node.
PriceTree.PTree
contains the prices.
PriceTree.tObs
contains the observation times.
PriceTree.dObs
contains the observation dates.
More About
Compound Option
A compound option is basically an option on an option; it gives the holder the right to buy or sell another option.
With a compound option, a vanilla stock option serves as the underlying instrument. Compound options thus have two strike prices and two exercise dates. For more information, see Compound Option.
References
[1] Rubinstein, Mark. “Double Trouble.” Risk. Vol. 5, 1991, p. 73.
Version History
Introduced before R2006aR2022b: Serial date numbers not recommended
Although compoundbycrr
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.
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes 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)