触碰
触碰
instrument object
描述
创建和定价触碰
instrument object for one or more Touch instruments using this workflow:
Use
FinInstrument
to create a触碰
instrument object for one or more Touch instruments.Use
finmodel
to specify aBlackScholes
,Bates
,Merton
, orHeston
模型触碰
instrument object.Choose a pricing method.
When using a
BlackScholes
model, useFinpricer
to specify aBlackScholes
or aVannaVolga
pricing method for one or moreBarrier
instruments.When using a
BlackScholes
,Heston
,Bates
, orMerton
model, useFinpricer
to specify anAssetMonteCarlo
pricing method for one or more触碰
instruments.
有关此工作流程的更多信息,请参阅Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments。
For more information on the available models and pricing methods for a触碰
乐器,请参阅Choose Instruments, Models, and Pricers。
Creation
Syntax
描述
creates a触碰Opt
= fininstrument(InstrumentType
,'ExerciseDate
',exercise_date,'屏障
',barrier_value,'PayoffValue
',payoff_value)触碰
instrument object for one or more Touch instruments by specifyingInstrumentType
并设置propertiesusing the required name-value pair argumentsExerciseDate
,屏障
, andPayoffValue
。
sets optionalpropertiesusing additional name-value pair arguments in addition to the required arguments in the previous syntax. For example,触碰Opt
= fininstrument(___,Name,Value
)触碰Opt = fininstrument("Touch",'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'PayoffValue',130,'BarrierType',"OT",'PayoffType',"Expiry",'Name',"Touch_option")
creates a触碰
option with an expiry payoff type. You can specify multiple name-value pair arguments.
Input Arguments
InstrumentType
—Instrument type
带有值的字符串“触碰”
|带有值的字符串数组of“触碰”
|character vector with value'触碰'
|单元阵列of character vectors with values of'触碰'
Instrument type, specified as a string with the value of“触碰”
, a character vector with the value of'触碰'
, anNinst
-经过-1
带有值的字符串数组of“触碰”
, or anNinst
-经过-1
单元阵列of character vectors with values of'触碰'
。
Data Types:char
|cell
|string
Specify required and 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
in quotes.
例子:触碰Opt = fininstrument("Touch",'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'PayoffValue',130,'BarrierType',"OT",'PayoffType',"Expiry",'Name',"Touch_option")
触碰
Name-Value Pair Arguments
ExerciseDate
—Option exercise date
datetime|序列日期编号|date character vector|日期字符串|vector of datetimes|向量的串行数字日期|日期字符矢量的单元格数组|日期字符串数组
Option exercise date, specified as the comma-separated pair consisting of“锻炼”
and a scalar datetime, serial date number, date character vector, date string or anNinst
-经过-1
vector of datetimes, serial date numbers, cell array of date character vectors, or date string array.
If you use date character vectors or date strings, the format must be recognizable bydatetime
because theExerciseDate
property is stored as a datetime.
Data Types:双倍的
|char
|cell
|string
|datetime
屏障
—Barrier level
标量数字|numeric vector
屏障水平,指定为逗号分隔对'BarrierValue'
and a scalar numeric or anNinst
-经过-1
numeric vector.
Data Types:双倍的
PayoffValue
—Option payoff value
标量数字|numeric vector
期权收益值,指定为逗号分隔对'PayoffValue'
and a scalar numeric or anNinst
-经过-1
numeric vector.
Data Types:双倍的
触碰
Name-Value Pair Arguments
Barriertype
—Barrier type
“ ot”
(default) |带有值的字符串“ ot”
or“ nt”
|带有值的字符串数组“ ot”
or“ nt”
|character vector with value'OT'
or'NT'
|单元阵列of character vectors with values'OT'
or'NT'
Barrier type, specified as the comma-separated pair consisting of'BarrierType'
and a scalar string or character vector or anNinst
-经过-1
单元阵列of character vectors or string array with one of the following values:
'OT'
— One-touchThe one-touch option provides a payoff if the underlying asset ever trades at or beyond the
屏障
。否则,PayoffValue
is zero.'NT'
— No-touchThe no-touch option provides a payoff if the underlying asset never trades at or beyond the
屏障
。否则,PayoffValue
is zero.
Data Types:char
|cell
|string
PayoffType
—Payoff type
"Hit"
(default) |带有值的字符串"Hit"
or“到期”
|带有值的字符串数组"Hit"
or“到期”
|character vector with value'Hit'
or'到期'
|单元阵列of character vectors with values'Hit'
or'到期'
Payoff type, specified as the comma-separated pair consisting of'PayoffType'
and a scalar string or character vector or anNinst
-经过-1
字符向量或字符串数组的单元格数组。您可以指定“到期”
only when you specify'OT'
as theBarriertype
。
Note
When you use aBlackScholes
价格r, only the"Hit"
PayoffType
is supported.
Data Types:char
|cell
|string
Name
—User-defined name for instrument
“”
(default) |string|string array|character vector|单元阵列of character vectors
用户定义的更多乐器名称,指定为逗号分隔对'Name'
and a scalar string or character vector or anNinst
-经过-1
字符向量或字符串数组的单元格数组。
Data Types:char
|cell
|string
Properties
ExerciseDate
—Option exercise date
datetime|vector of datetimes
期权锻炼日期,返回为标量日期或Ninst
-经过-1
数据矢量。
Data Types:datetime
屏障
—Barrier level
标量数字|numeric vector
Barrier level, returned as a scalar numeric or anNinst
-经过-1
numeric vector.
Data Types:双倍的
PayoffValue
—Option payoff
标量数字|numeric vector
期权收益,返回为标量数字或Ninst
-经过-1
numeric vector.
Data Types:双倍的
Barriertype
—Barrier type
“ ot”
(default) |带有值的字符串“ ot”
or“ nt”
|带有值的字符串数组“ ot”
or“ nt”
Barrier type, returned as a scalar string or anNinst
-经过-1
string array.
Data Types:string
PayoffType
—Payoff type
"Hit"
(default) |带有值的字符串"Hit"
or“到期”
|带有值的字符串数组"Hit"
or“到期”
Option type, returned as a scalar string or anNinst
-经过-1
string array.
Data Types:string
Name
—User-defined name for instrument
“”
(default) |string|string array
User-defined name for the instrument, returned as a scalar string or anNinst
-经过-1
string array.
Data Types:string
例子
Price Touch Instrument Using a Black-Scholes Model and Asset Monte Carlo Pricer
此示例显示了工作流程的价格触碰
instrument when you use aBlackScholes
model and anAssetMonteCarlo
pricing method.
Create触碰
Instrument Object
UseFinInstrument
to create a触碰
instrument object.
触碰Opt = fininstrument(“触碰”,“锻炼”,datetime(2022,9,15),'BarrierValue', 100,'PayoffValue',110,'BarrierType',“ ot”,'Name',“ touch_option”)
触碰Opt = Touch with properties: ExerciseDate: 15-Sep-2022 BarrierValue: 100 PayoffValue: 110 BarrierType: "ot" PayoffType: "expiry" Name: "touch_option"
CreateBlackScholes
模型对象
Usefinmodel
to create aBlackScholes
model object.
BlackScholesModel = finmodel(“黑色”,'Volatility',.2)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2000 Correlation: 1
Createratecurve
目的
Create a flatratecurve
object usingratecurve
。
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('零',Settle,Maturity,Rate,'基础',12)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 12 Dates: 15-Sep-2023 Rates: 0.0350 Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
CreateAssetMonteCarlo
Pricer Object
UseFinpricer
to create anAssetMonteCarlo
价格r object and use theratecurve
object for the'DiscountCurve'
name-value pair argument.
outPricer = finpricer(“ AssetMontecarlo”,'DiscountCurve',myRC,"Model",BlackScholesModel,'SpotPrice',102,'simulationDates',DateTime(2022,9,15))
outPricer = GBMMonteCarlo with properties: DiscountCurve: [1x1 ratecurve] SpotPrice: 102 SimulationDates: 15-Sep-2022 NumTrials: 1000 RandomNumbers: [] Model: [1x1 finmodel.BlackScholes] DividendType: "continuous" DividendValue: 0
Price Touch Instrument
Use价格
to compute the price and sensitivities for the触碰
乐器。
[Price, outPR] = price(outPricer,TouchOpt,[“全部”)))
价格=91.1862
outPR = priceresult with properties: Results: [1x7 table] PricerData: [1x1 struct]
expr.results
ans =1×7 table价格delta gamma lambda rho theta vega ______ _______ _________________________________________________________________________________________________________________________________________________一些0.0-2.4.2.4 0.03.2.4.2.4-2.4-2.4-2-2-2-2-2-2-2-2-2-2-2-2.1,,.0-2.4.2.4很多
Price Multiple Touch Instruments Using Black-Scholes Model and Black-Scholes Pricer
此示例显示了工作流程的价格多个触碰
当你使用工具BlackScholes
model and aBlackScholes
pricing method.
Create触碰
Instrument Object
UseFinInstrument
to create a触碰
instrument object for three Touch instruments.
触碰Opt = fininstrument(“触碰”,“锻炼”,datetime([2022,9,15 ; 2022,10,15 ; 2022,11,15]),'BarrierValue',[140 ; 160 ; 190],'PayoffValue',170,'BarrierType',“ ot”,'Name',“ touch_option”)
触碰Opt=3×1 object3x1 Touch array with properties: ExerciseDate BarrierValue PayoffValue BarrierType PayoffType Name
CreateBlackScholes
模型对象
Usefinmodel
to create aBlackScholes
model object.
BlackScholesModel = finmodel(“黑色”,'Volatility',0.28)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2800 Correlation: 1
Createratecurve
目的
Create a flatratecurve
object usingratecurve
。
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('零',Settle,Maturity,Rate,'基础',12)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 12 Dates: 15-Sep-2023 Rates: 0.0350 Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
CreateBlackScholes
Pricer Object
UseFinpricer
to create aBlackScholes
价格r object and use theratecurve
object for the'DiscountCurve'
name-value pair argument.
outPricer = finpricer("analytic",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',135,'DividendValue',0.045)
outPricer = BlackScholes with properties: DiscountCurve: [1x1 ratecurve] Model: [1x1 finmodel.BlackScholes] SpotPrice: 135 DividendValue: 0.0450 DividendType: "continuous"
Price触碰
Instruments
Use价格
to compute the prices and sensitivities for the触碰
instruments.
[Price, outPR] = price(outPricer,TouchOpt,[“全部”)))
价格=3×1136.5553 99.8742 63.6835
outPR=3×1 object3x1 priceresult array with properties: Results PricerData
expr.results
ans =1×7 tablePrice Delta Gamma Lambda Vega Theta Rho ______ ______ ________ ______ ______ ______ _______ 136.56 2.2346 0.005457 2.2092 30.812 3.9013 -465.89
ans =1×7 table价格delta gamma lambda vega theta rho ______ ______ ______ __________________________________________________________________________________________________________________________________一些0.000.008 0.008 0.0080.008 0.00.0080.00.00.008 0.00.00.00.008 0.00.004.80.00.00.004-19.00.19.000.00.19 0.00.004 0.00,
ans =1×7 table价格delta gamma lambda vega theta rho ______ ______ _____________________________________________________________________________________________________________________________________________________EN 0.0002020202,202很多,2.8028 182.58 -3.0963 72.793
Price Touch Instrument Using Heston Model and Asset Monte Carlo Pricer
此示例显示了工作流程的价格触碰
instrument when you use aHeston
model and anAssetMonteCarlo
pricing method.
Create触碰
Instrument Object
UseFinInstrument
to create a触碰
instrument object.
触碰Opt = fininstrument(“触碰”,“锻炼”,datetime(2022,9,15),'BarrierValue',110,'PayoffValue',140,'BarrierType',“ ot”,'Name',“ touch_option”)
touchOpt =触摸属性:行使:15-Sep-2022 BarrierValue:110 PayOffValue:140 Barriertype:“ ot” PayoffType:“ Expiry” Name:“ Touch_option”
CreateHeston
模型对象
Usefinmodel
to create aHeston
model object.
HestonModel = finmodel("Heston",'v0', 0.032,'ThetaV',0.1,'kappa',0.003,'sigmav',0.2,'RhoSV',0.9)
HestonModel = Heston with properties: V0: 0.0320 ThetaV: 0.1000 Kappa: 0.0030 SigmaV: 0.2000 RhoSV: 0.9000
Createratecurve
目的
Create a flatratecurve
object usingratecurve
。
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('零',Settle,Maturity,Rate,'基础',12)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 12 Dates: 15-Sep-2023 Rates: 0.0350 Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
CreateAssetMonteCarlo
Pricer Object
UseFinpricer
to create anAssetMonteCarlo
价格r object and use theratecurve
object for the'DiscountCurve'
name-value pair argument.
outPricer = finpricer(“ AssetMontecarlo”,'DiscountCurve',myRC,"Model",HestonModel,'SpotPrice',112,'simulationDates',DateTime(2022,9,15))
outPricer = HestonMonteCarlo with properties: DiscountCurve: [1x1 ratecurve] SpotPrice: 112 SimulationDates: 15-Sep-2022 NumTrials: 1000 RandomNumbers: [] Model: [1x1 finmodel.Heston] DividendType: "continuous" DividendValue: 0
Price触碰
Instrument
Use价格
to compute the price and sensitivities for the触碰
乐器。
[Price, outPR] = price(outPricer,TouchOpt,[“全部”)))
价格= 63.5247
outPR = priceresult with properties: Results: [1x8 table] PricerData: [1x1 struct]
expr.results
ans =1×8 tablePrice Delta Gamma Lambda Rho Theta Vega VegaLT ______ _______ ______ _______ _______ ______ ______ ______ 63.525 -7.2363 1.0541 -12.758 -320.21 3.5527 418.94 8.1498
Price Touch Instrument Using Black-Scholes Model and Black-Scholes Pricer
此示例显示了工作流程的价格触碰
instrument when you use aBlackScholes
model and aBlackScholes
pricing method.
Create触碰
Instrument Object
UseFinInstrument
to create a触碰
instrument object.
触碰Opt = fininstrument(“触碰”,“锻炼”,datetime(2022,9,15),'BarrierValue',140,'PayoffValue',170,'BarrierType',“ ot”,'Name',“ touch_option”)
触碰Opt = Touch with properties: ExerciseDate: 15-Sep-2022 BarrierValue: 140 PayoffValue: 170 BarrierType: "ot" PayoffType: "expiry" Name: "touch_option"
CreateBlackScholes
模型对象
Usefinmodel
to create aBlackScholes
model object.
BlackScholesModel = finmodel(“黑色”,'Volatility',0.28)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2800 Correlation: 1
Createratecurve
目的
Create a flatratecurve
object usingratecurve
。
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('零',Settle,Maturity,Rate,'基础',12)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 12 Dates: 15-Sep-2023 Rates: 0.0350 Settle: 15-Sep-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
CreateBlackScholes
Pricer Object
UseFinpricer
to create aBlackScholes
价格r object and use theratecurve
object for the'DiscountCurve'
name-value pair argument.
outPricer = finpricer("analytic",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',135,'DividendValue',0.045)
outPricer = BlackScholes with properties: DiscountCurve: [1x1 ratecurve] Model: [1x1 finmodel.BlackScholes] SpotPrice: 135 DividendValue: 0.0450 DividendType: "continuous"
Price触碰
Instrument
Use价格
to compute the price and sensitivities for the触碰
乐器。
[Price, outPR] = price(outPricer,TouchOpt,[“全部”)))
价格=136.5553
extpr =具有属性的定价:结果:[1x7表] PricerData:[]
expr.results
ans =1×7 tablePrice Delta Gamma Lambda Vega Theta Rho ______ ______ ________ ______ ______ ______ _______ 136.56 2.2346 0.005457 2.2092 30.812 3.9013 -465.89
More About
触碰Option
Atouchoption (also known as a binary barrier option or American digital) is a path-dependent option in which the existence and payment of the options depend on the movement of the underlying spot through their option life.
The one-touch (no-touch) option provides a payoff if the underlying spot ever (never) trades at or beyond the barrier level and otherwise it is zero. For more information, seeOne-Touch and Double One-Touch Options。
Version History
开放示例
You have a modified version of this example. Do you want to open this example with your edits?
matlab命令
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é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
- 英国(英语)