dblbarriersensbybls
Calculate prices and sensitivities for European double barrier options using BlackScholes option pricing model
Since R2019a
Syntax
Description
calculates European double barrier option prices and sensitivities using the
BlackScholes option pricing model and the Ikeda and Kunitomo approximation.PriceSens
= dblbarriersensbybls(RateSpec
,StockSpec
,OptSpec
,Strike
,Settle
,ExerciseDates
,BarrierSpec
,Barrier
)
Note
Alternatively, you can use the DoubleBarrier
object to calculate price or sensitivities for
double barrier options. For more information, see Get Started with Workflows Using ObjectBased Framework for Pricing Financial Instruments.
specifies options using one or more namevalue pair arguments in addition to the
input arguments in the previous syntax.PriceSens
= dblbarriersensbybls(___,Name,Value
)
Examples
Calculate Price and Sensitivities for a European Double KnockOut Call Option
Compute the price and sensitivities for a European double knockout (down and outup and out) call option using the following data:
Rate = 0.05; Settle = datetime(2018,6,1); Maturity = datetime(2018,12,1); Basis = 1;
Define a RateSpec
.
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates', Maturity,'Rates', Rate, 'Compounding', 1, 'Basis', Basis);
Define a StockSpec
.
AssetPrice = 100; Volatility = 0.25; StockSpec = stockspec(Volatility, AssetPrice);
Define the double barrier option and sensitivities.
LBarrier = 80; UBarrier = 130; Barrier = [UBarrier LBarrier]; BarrierSpec = 'DKO'; OptSpec = 'Call'; Strike = 110; OutSpec = {'Price', 'Delta', 'Gamma'};
Compute the price of the option using flat boundaries.
[PriceFlat, Delta, Gamma] = dblbarriersensbybls(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity, BarrierSpec, Barrier,'OutSpec', OutSpec)
PriceFlat = 1.1073
Delta = 0.0411
Gamma = 0.0040
Compute the price of the option using two curved boundaries.
Curvature = [0.05 0.05]; [PriceCurved, Delta, Gamma] = dblbarriersensbybls(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity, BarrierSpec, Barrier, 'Curvature', Curvature,'OutSpec', OutSpec)
PriceCurved = 1.4548
Delta = 0.0620
Gamma = 0.0045
Input Arguments
StockSpec
— Stock specification for underlying asset
structure
Stock specification for the underlying asset, specified by the
StockSpec
obtained from stockspec
.
stockspec
handles several
types of underlying assets. For example, for physical commodities the price
is StockSpec.Asset
, the volatility is
StockSpec.Sigma
, and the convenience yield is
StockSpec.DividendAmounts
.
Data Types: struct
OptSpec
— Definition of option
cell array of character vectors with values 'call'
or
'put'
 string array with values "call"
or
"put"
Definition of the option as 'call'
or
'put'
, specified as a
NINST
by1
cell array of character
vectors or string array with values 'call'
or
'put'
or "call"
or
"put"
.
Data Types: char
 cell
 string
Strike
— Option strike price value
matrix
Option strike price value, specified as an
NINST
by1
matrix of numeric
values, where each row is the schedule for one option.
Data Types: double
Settle
— Settlement or trade date
datetime array  string array  date character vector
Settlement or trade date for the double barrier option, specified as an
NINST
by1
vector using a datetime
array, string array, or date character vectors.
To support existing code, dblbarriersensbybls
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 an
NINST
by1
vector using a datetime
array, string array, or date character vectors.
Note
For a European option, the option expiry date has only one
ExerciseDates
value, which is the maturity of
the instrument.
To support existing code, dblbarriersensbybls
also
accepts serial date numbers as inputs, but they are not recommended.
BarrierSpec
— Double barrier option type
cell array of character vectors with values of 'DKI'
or 'DKO'
 string array with values of "DKI"
or
"DKO"
Double barrier option type, specified as an
NINST
by1
cell array of character
vectors or string array with the following values:
'DKI'
— Double KnockinThe
'DKI'
option becomes effective when the price of the underlying asset reaches one of the barriers. It gives the option holder the right but not the obligation to buy or sell the underlying security at the strike price, if the underlying asset goes above or below the barrier levels during the life of the option.'DKO'
— Double KnockoutThe
'DKO'
option gives the option holder the right but not the obligation to buy or sell the underlying security at the strike price, as long as the underlying asset remains between the barrier levels during the life of the option. This option terminates when the price of the underlying asset passes one of the barriers.
Option  Barrier Type  Payoff If Any Barrier Crossed  Payoff If Barriers Not Crossed 

Call/Put  Double Knockin  Standard Call/Put  Worthless 
Call/Put  Double Knockout  Worthless  Standard Call/Put 
Data Types: char
 cell
 string
Barrier
— Double barrier value
matrix
Double barrier value, specified as
NINST
by1
matrix of numeric
values, where each element is a 1
by2
vector where the first column is
Barrier
(1)(UB
) and the second
column is Barrier
(2)(LB
).
Barrier
(1) must be greater than
Barrier
(2).
Data Types: double
NameValue Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Namevalue arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: PriceSens =
dblbarriersensbybls(RateSpec,StockSpec,OptSpec,Strike,Settle,Maturity,BarrierSpec,Barrier,'Curvature',[1,5],'OutSpec','Delta')
Curvature
— Curvature levels of the upper and lower barriers
[]
(default)  matrix
Curvature levels of the upper and lower barriers, specified as the
commaseparated pair consisting of 'Curvature'
and an
NINST
by1
matrix of numeric
values, where each element is a
1
by2
vector. The first
column is the upper barrier curvature (d1) and the
second column is the lower barrier curvature (d2).
d1 = d2 =
0
corresponds to two flat boundaries.d1 < 0 < d2 corresponds to an exponentially growing lower boundary and an exponentially decaying upper boundary.
d1 > 0 > d2 corresponds to a convex downward lower boundary and a convex upward upper boundary.
Data Types: double
OutSpec
— Define outputs
{'Price'}
(default)  character vector with values 'Price'
,
'Delta'
, 'Gamma'
,
'Vega'
, 'Lambda'
,
'Rho'
, 'Theta'
, and
'All'
 cell array of character vectors with values
'Price'
, 'Delta'
,
'Gamma'
, 'Vega'
,
'Lambda'
, 'Rho'
,
'Theta'
, and 'All'
 string array with values "Price"
,
"Delta"
, "Gamma"
,
"Vega"
, "Lambda"
,
"Rho"
, "Theta"
, and
"All"
Define outputs, specified as the commaseparated pair consisting of
'OutSpec'
and a NOUT

by1
or a
1
byNOUT
cell array of
character vectors with possible values of 'Price'
,
'Delta'
, 'Gamma'
,
'Vega'
, 'Lambda'
,
'Rho'
, 'Theta'
, and
'All'
.
OutSpec = {'All'}
specifies that the output is
Delta
, Gamma
,
Vega
, Lambda
,
Rho
, Theta
, and
Price
, in that order. This is the same as
specifying OutSpec
to include each
sensitivity.
Example: OutSpec =
{'delta','gamma','vega','lambda','rho','theta','price'}
Data Types: char
 cell
Output Arguments
PriceSens
— Expected prices or sensitivities for double barrier options
matrix
Expected prices at time 0 or sensitivities (defined using
OutSpec
) for double barrier options, returned as a
NINST
by1
matrix.
More About
Double Barrier Option
A double barrier option is similar to the
standard single barrier option except that it has two barrier levels: a lower
barrier (LB
) and an upper barrier (UB
).
The payoff for a double barrier option depends on whether the underlying asset remains between the barrier levels during the life of the option. Double barrier options are less expensive than single barrier options as they have a higher knockout probability. Because of this, double barrier options allow investors to reduce option premiums and match an investor’s belief about the future movement of the underlying price process.
Ikeda and Kunitomo Approximation
The analytical formulas of Ikeda and Kunitomo approach pricing as constrained by curved boundaries.
This approach has the advantage of covering barriers that are flat, have exponential growth or decay, or are concave. The Ikeda and Kunitomo model for pricing double barrier options focuses on calculating double knockout barriers.
References
[1] Hull, J. Options, Futures, and Other Derivatives. Fourth Edition. Upper Saddle River, NJ: Prentice Hall, 2000.
[2] Kunitomo, N., and M. Ikeda. “Pricing Options with Curved Boundaries.” Mathematical Finance. Vol. 2, Number 4, 1992.
[3] Rubinstein, M., and E. Reiner. “Breaking Down the Barriers.” Risk. Vol. 4, Number 8, 1991, pp. 28–35.
Version History
Introduced in R2019aR2022b: Serial date numbers not recommended
Although dblbarriersensbybls
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.
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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)