barriersensbyls
Calculate price and sensitivities for European or American barrier options using Monte Carlo simulations
Syntax
描述
例子
Compute the Delta and Gamma of an American Barrier Down In Put Option
Compute the price of an American down in put option using the following data:
费率= 0.0325;定居='01 -Jan-2016';Maturity ='01 -Jan-2017';复合= -1;基础= 1;
Define aRateSpec
.
Ratespec = IntenVset('ValuationDate',Settle,“开始日”,Settle,'EndDates',Maturity,...'Rates',费率,'Compounding',Compounding,'基础',基础)
RateSpec =struct with fields:FinObj: 'RateSpec' Compounding: -1 Disc: 0.9680 Rates: 0.0325 EndTimes: 1 StartTimes: 0 EndDates: 736696 StartDates: 736330 ValuationDate: 736330 Basis: 1 EndMonthRule: 1
Define aStockSpec
.
AssetPrice = 40;波动率= 0.20;StockSpec = StockSpec(波动性,资产量)
StockSpec =struct with fields:FinOBJ:“ Stockspec” Sigma:0.2000 AssetPrice:40 resdendtype:[] RictendAmounts:0 ExdividendEdendDates:[]
计算美国障碍物的三角洲和伽玛。
罢工= 45; OptSpec ='put';Barrier = 35; BarrierSpec ='DI';AmericanOpt = 1; OutSpec = {'delta','gamma'};[delta,伽马] = barriersensbyls(Ratesspec,Stockspec,Optspec,罢工,定居...Maturity,BarrierSpec,Barrier,“数字”,2000年,'AmericanOpt',AmericanOpt,'OutSpec',否定)
Delta = -0.6346
伽马= -0.3091
Input Arguments
OptSpec
—Definition of option
character vector with values'call'
or'put'
|带有值的字符串数组"call"
or"put"
Definition of the option as'call'
or'put'
,指定为具有值的字符向量或字符串数组"call"
or"put"
.
数据类型:char
|string
罢工
—期权行动价值
标量数字
期权行动价值, specified as a scalar numeric.
数据类型:双倍的
Settle
—Settlement or trade date
序列日期编号|date character vector|datetime object
Settlement or trade date for the barrier option, specified as a serial date number, a date character vector, or a datetime object.
数据类型:双倍的
|char
|datetime
ExerciseDates
—Option exercise dates
序列日期编号|date character vector|datetime object
选项练习日期,指定为序列日期编号,日期字符向量或DateTime对象:
对于欧洲选择,只有一个
ExerciseDates
on the option expiry date which is the maturity of the instrument.For an American option, use a
1
-经过-2
vector of exercise date boundaries. The option can be exercised on any date between or including the pair of dates on that row. If only one non-NaN
date is listed, the option can be exercised betweenSettle
和单个列出的日期ExerciseDates
.
数据类型:双倍的
|char
|cell
BarriersPec
—障碍选项类型
character vector with values:'UI'
,'uo'
,'DI'
,'做'
屏障选项类型,指定为具有以下值的字符向量:
'UI'
— Up Knock-in这个选项th时生效e price of the underlying asset passes above the barrier level. It gives the option holder the right, but not the obligation, to buy or sell (call/put) the underlying security at the strike price if the underlying asset goes above the barrier level during the life of the option.
'uo'
- 上淘汰赛This option gives the option holder the right, but not the obligation, to buy or sell (call/put) the underlying security at the strike price as long as the underlying asset does not go above the barrier level during the life of the option. This option terminates when the price of the underlying asset passes above the barrier level. Usually with an up-and-out option, the rebate is paid if the spot price of the underlying reaches or exceeds the barrier level.
'DI'
— Down Knock-in这个选项th时生效e price of the underlying stock passes below the barrier level. It gives the option holder the right, but not the obligation, to buy or sell (call/put) the underlying security at the strike price if the underlying security goes below the barrier level during the life of the option. With a down-and-in option, the rebate is paid if the spot price of the underlying does not reach the barrier level during the life of the option.
'做'
— Down Knock-upThis option gives the option holder the right, but not the obligation, to buy or sell (call/put) the underlying asset at the strike price as long as the underlying asset does not go below the barrier level during the life of the option. This option terminates when the price of the underlying security passes below the barrier level. Usually, the option holder receives a rebate amount if the option expires worthless.
Option | Barrier Type | Payoff if Barrier Crossed | Payoff if Barrier not Crossed |
---|---|---|---|
Call/Put | Down Knock-out | 毫无价值 | Standard Call/Put |
Call/Put | Down Knock-in | Call/Put | 毫无价值 |
Call/Put | 上淘汰赛 | 毫无价值 | Standard Call/Put |
Call/Put | Up Knock-in | Standard Call/Put | 毫无价值 |
数据类型:char
Barrier
—Barrier level
标量数字
Barrier level, specified as a scalar numeric.
数据类型:双倍的
Name-Value Arguments
Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN
, 在哪里Name
is the argument name andValue
是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。
Before R2021a, use commas to separate each name and value, and encloseName
用引号。
例子:价格= barriersensbyls(Ratesspec,Stockspec,Optspec,罢工,定居点,成熟,障碍,障碍,障碍,回扣,1000)
AmericanOpt
—Option type
0
(欧洲的)(default) |值[0,1]
Option type, specified as the comma-separated pair consisting of'AmericanOpt'
以及具有以下值之一的标量标志:
0
— European1
- 美国人
Note
对于美国选择,使用Longstaff-Schwartz最小二乘法来计算早期锻炼溢价。For more information on the least squares method, seehttps://people.math.ethz.ch/%7Ehjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf.
数据类型:双倍的
Rebate
—回扣价值
0
(default) |数字
回扣价值,指定为逗号分隔对'Rebate'
and a scalar numeric. For Knock-in options, theRebate
is paid at expiry. For Knock-out options, theRebate
is paid when theBarrier
is reached.
数据类型:双倍的
NumTrials
—Number of independent sample paths
1000
(default) |nonnegative integer
Number of independent sample paths (simulation trials), specified as the comma-separated pair consisting of“数字”
和标量非负整数。
数据类型:双倍的
numperiods
—Number of simulation periods per trial
100
(default) |nonnegative integer
Number of simulation periods per trial, specified as the comma-separated pair consisting of'NumPeriods'
和标量非负整数。
数据类型:双倍的
Z
—Time series array of dependent random variates
vector
相关随机变体的时间序列阵列,指定为逗号分隔对'Z'
and anumperiods
-经过-1
-经过-NumTrials
3-D time series array. TheZ
值生成驱动模拟的布朗运动矢量(即维纳过程)。
数据类型:双倍的
Antithetic
—Indicator for antithetic sampling
false
(default) |logical flag with value oftrue
orfalse
Indicator for antithetic sampling, specified as the comma-separated pair consisting of'Antithetic'
and a scalar value oftrue
orfalse
.
数据类型:logical
OutSpec
—Define outputs
{'价格'}
(default) |character vector with values'Price'
,'Delta'
,'Gamma'
,'vega'
,'Lambda'
,'Rho'
,“θ”
, and'All'
|cell array of character vectors with values'Price'
,'Delta'
,'Gamma'
,'vega'
,'Lambda'
,'Rho'
,“θ”
, and'All'
Define outputs, specified as the comma-separated pair consisting of'OutSpec'
and aNOUT
- by-1
or a1
-经过-NOUT
cell array of character vectors with possible values of'Price'
,'Delta'
,'Gamma'
,'vega'
,'Lambda'
,'Rho'
,“θ”
, and'All'
.
OutSpec = {'All'}
指定输出为Delta
,伽玛
,维加
,Lambda
,Rho
,Theta
, andPrice
, in that order. This is the same as specifyingOutSpec
to include each sensitivity.
例子:OUTSPEC = {'delta','gamma','vega','lambda','rho','theta','price'}
数据类型:char
|cell
MonitoringFreq
—Number of days between monitoring barriers
0
(default) |integer
监视障碍之间的天数,指定为标量整数。默认值为0
这表明屏障是连续监测的。
数据类型:双倍的
Output Arguments
PriceSens
— Expected prices or sensitivities for barrier options
matrix
Expected prices or sensitivities (defined usingOutSpec
) for barrier options, returned as aNinst
-经过-1
matrix.
Paths
— Simulated paths of correlated state variables
vector
Simulated paths of correlated state variables, returned as anumperiods+ 1
-经过-1
-经过-NumTrials
3-D time series array of simulated paths of correlated state variables. Each row ofPaths
is the transpose of the state vectorX(t)tfor a given trial.
时代
- 与模拟路径相关的观察时间
vector
与模拟路径相关的观察时间,返回numperiods+ 1
-经过-1
与模拟路径相关的观察时间列矢量。每个元素时代
is associated with the corresponding row ofPaths
.
Z
— Time series array of dependent random variates
vector
Time series array of dependent random variates, returned as anumperiods
-经过-1
-经过-NumTrials
3-D array whenZ
is specified as an input argument. If theZ
input argument is not specified, then theZ
输出参数包含内部生成的随机变体。
More About
Barrier Option
A Barrier option has not only a strike price but also a barrier level and sometimes a rebate.
A rebate is a fixed amount that is paid if the option cannot be exercised because the barrier level has been reached or not reached. The payoff for this type of option depends on whether the underlying asset crosses the predetermined trigger value (barrier level), indicated byBarrier
,在期权的生命中。有关更多信息,请参阅Barrier Option.
参考
[1] Hull, J.Options, Futures and Other DerivativesFourth Edition. Prentice Hall, 2000, pp. 646-649.
[2] Aitsahlia,F.,L。Imhof和T.L.莱。“美国淘汰赛的定价和对冲。”衍生物杂志。卷。11.3, 2004, pp. 44–50.
[3] Broadie, M., P. Glasserman and S. Kou. "A continuity correction for discrete barrier options."Mathematical Finance.卷。7.4,1997,第3250–349页。
[4] Moon, K.S. "Efficient Monte Carlo algorithm for pricing barrier options."Communications of the Korean Mathematical Society.Vol 23.2, 2008 pp. 85–294.
[5] Papatheodorou,B。“Enhanced Monte Carlo methods for pricing and hedging exotic options."University of Oxford thesis, 2005.
[6] Rubinstein M. and E. Reiner. “Breaking down the barriers.”风险。卷。4(8), 1991, pp. 28–35.
Version History
matlab命令
You clicked a link that corresponds to this MATLAB command:
通过在MATLAB命令窗口中输入该命令。Web浏览器不支持MATLAB命令。金宝app
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éricaLatina(Español)
- Canada(英语)
- United States(英语)
Europe
- 比利时(英语)
- 丹麦(英语)
- Deutschland(Deutsch)
- España(Español)
- Finland(英语)
- France(Français)
- Ireland(英语)
- Italia(Italiano)
- Luxembourg(英语)
- Netherlands(英语)
- Norway(英语)
- Österreich(Deutsch)
- Portugal(英语)
- Sweden(英语)
- Switzerland
- 英国(英语)