Calculate double barrier option price using finite difference method
[Price,PriceGrid,AssetPrices,Times] = dblbarrierbyfd(RateSpec,StockSpec,OptSpec,Strike,Settle,ExerciseDates,BarrierSpec,Barrier)
[Price,PriceGrid,AssetPrices,Times] = dblbarrierbyfd(___,Name,Value)
calculates a European or American call or put double barrier option price on a
single underlying asset using the finite difference method.
dblbarrierbyfd assumes that the barrier is continuously
Compute the price of an American double barrier option for a double knock-out (down and out-up and out) call option with a rebate using the following data:
Rate = 0.05; Settle = '01-Jun-2018'; Maturity = '01-Dec-2018'; Basis = 1;
RateSpec = intenvset('ValuationDate', Settle, 'StartDates', Settle, 'EndDates', Maturity,'Rates', Rate, 'Compounding', -1, 'Basis', Basis);
AssetPrice = 100; Volatility = 0.25; StockSpec = stockspec(Volatility, AssetPrice);
Define the double barrier option.
LBarrier = 80; UBarrier = 130; Barrier = [UBarrier LBarrier]; BarrierSpec = 'DKO'; OptSpec = 'Call'; Strike = 110; Rebate = 1;
Compute the price of an American option using finite differences.
Price = dblbarrierbyfd(RateSpec, StockSpec, OptSpec, Strike, Settle, Maturity, BarrierSpec, Barrier,'Rebate', Rebate, 'AmericanOpt', 1)
Price = 4.0002
StockSpec— Stock specification for underlying asset
Stock specification for the underlying asset, specified by the
StockSpec obtained from
stockspec handles several
types of underlying assets. For example, for physical commodities the price
StockSpec.Asset, the volatility is
StockSpec.Sigma, and the convenience yield is
OptSpec— Definition of option
'put'| string scalar with values
Definition of an option, specified as a character vector with a value of
'put', or a string
scalar with values
Strike— Option strike price value
Option strike price value, specified as a scalar numeric.
Settle— Settlement or trade date
Settlement or trade date for the barrier option, specified as a serial date number, a date character vector, or a datetime object.
ExerciseDates— Option exercise dates
Option exercise dates, specified as a date character vector, a serial date number, or datetime object.
For a European option, the option expiry date has only one
For an American option, use a
2 vector of
exercise date boundaries. The option can be exercised on any
date between or including the pair of dates. If only one
NaN date is listed, the option can be
Settle and the single
listed date in
BarrierSpec— Double barrier option type
'DKO'| scalar string with value of
Double barrier option type, specified as a character vector or string with one of the following values:
'DKI' — Double Knock-in
'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 Knock-out
'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 Knock-in||Standard Call/Put||Worthless|
|Call/Put||Double Knock-out||Worthless||Standard Call/Put|
Barrier— Barrier level
Barrier level, specified as a
vector of numeric values, where the first column is the upper barrier
(1)(UB) and the second column is the lower barrier (2)(LB). Barrier(1) must
be greater than Barrier(2).
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Price = dblbarrierbyfd(RateSpec,StockSpec,OptSpec,Strike,Settle,Maturity,BarrierSpec,Barrier,'Rebate',[100,100])
'Rebate'— Rebate value
[0 0]for Double Knock-out or
0for Double Knock-in (default) | vector | scalar numeric
Rebate value, specified as the comma-separated pair consisting of
'Rebate' and one of the following:
For a Double Knock-out option, use a
2 vector of
rebate values where the first column is the payout if the
upper barrier(1)(UB) is hit and the second column is payout
if the lower barrier(2)(LB) is hit. The rebate is paid when
the barrier is reached.
For a Double Knock-in option, use a scalar rebate value. The rebate is paid at expiry.
'AssetGridSize'— Size of asset grid used for a finite difference grid
400(default) | positive scalar numeric
Size of the asset grid used for the finite difference grid, specified
as the comma-separated pair consisting of
'AssetGridSize' and a positive scalar
'TimeGridSize'— Size of time grid used for finite difference grid
100(default) | positive scalar numeric
Size of the time grid used for the finite difference grid, specified
as the comma-separated pair consisting of
'TimeGridSize' and a positive scalar numeric.
The actual time grid may have a larger size because exercise
and ex-dividend dates might be added to the grid from
'AmericanOpt'— Option type
0European (default) | integer with values
Option type, specified as the comma-separated pair consisting of
'AmericanOpt' and a scalar flag with one of the
0 — European
1 — American
Price— Expected prices for double barrier options
Expected prices for double barrier options, returned as a
PriceGrid— Grid containing prices
Grid containing prices calculated by the finite difference method,
returned as a two-dimensional grid with the size
AssetGridSize*TimeGridSize. The number of columns
does not have to be equal to the
exercise and ex-dividend dates in
StockSpec are added
to the time grid.
PriceGrid(:, end) contains the price
t = 0.
Times— Times corresponding to second dimension of
Times corresponding to the second dimension of
PriceGrid, returned as a vector.
A double barrier option is similar to the
standard single barrier option except that it has two barrier levels: a lower
LB) and an upper barrier (
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 knock-out 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.
 Boyle, P., and Y. Tian. “An Explicit Finite Difference Approach to the Pricing of Barrier Options.” Applied Mathematical Finance. Vol. 5, Number 1, 1998, pp. 17–43.
 Hull, J. Options, Futures, and Other Derivatives. Fourth Edition. Upper Saddle River, NJ: Prentice Hall, 2000, pp. 646–649.
 Rubinstein, M., and E. Reiner. “Breaking Down the Barriers.” Risk. Vol. 4, Number 8, 1991, pp. 28–35.
 Zvan, R., P. A. Forsyth and K. R. Vetzal. “PDE Methods for Pricing Barrier Options.” Journal of Economic Dynamics and Control. Vol. 24, Number 11-12, 2000, pp. 1563–1590.