主要内容

触碰

触碰instrument object

描述

创建和定价触碰instrument object for one or more Touch instruments using this workflow:

  1. UseFinInstrumentto create a触碰instrument object for one or more Touch instruments.

  2. Usefinmodelto specify aBlackScholes,Bates,Merton, orHeston模型触碰instrument object.

  3. Choose a pricing method.

    • When using aBlackScholesmodel, useFinpricerto specify aBlackScholesor aVannaVolgapricing method for one or moreBarrierinstruments.

    • When using aBlackScholes,Heston,Bates, orMertonmodel, useFinpricerto specify anAssetMonteCarlopricing 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

描述

example

触碰Opt= fininstrument(InstrumentType,'ExerciseDate',exercise_date,'屏障',barrier_value,'PayoffValue',payoff_value)creates a触碰instrument object for one or more Touch instruments by specifyingInstrumentType并设置propertiesusing the required name-value pair argumentsExerciseDate,屏障, andPayoffValue

example

触碰Opt= fininstrument(___,Name,Value)sets optionalpropertiesusing additional name-value pair arguments in addition to the required arguments in the previous syntax. For example,触碰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

expand all

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

Name-Value Arguments

Specify required and optional pairs of arguments asName1=Value1,...,NameN=ValueN, 在哪里Nameis the argument name andValue是相应的值。名称值参数必须在其他参数之后出现,但是对的顺序并不重要。

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

例子:触碰Opt = fininstrument("Touch",'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'PayoffValue',130,'BarrierType',"OT",'PayoffType',"Expiry",'Name',"Touch_option")

必需的触碰Name-Value Pair Arguments

expand all

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-经过-1vector 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 bydatetimebecause theExerciseDateproperty is stored as a datetime.

Data Types:双倍的|char|cell|string|datetime

屏障水平,指定为逗号分隔对'BarrierValue'and a scalar numeric or anNinst-经过-1numeric vector.

Data Types:双倍的

期权收益值,指定为逗号分隔对'PayoffValue'and a scalar numeric or anNinst-经过-1numeric vector.

Data Types:双倍的

Optional触碰Name-Value Pair Arguments

expand all

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-touch

    The one-touch option provides a payoff if the underlying asset ever trades at or beyond the屏障。否则,PayoffValueis zero.

  • 'NT'— No-touch

    The no-touch option provides a payoff if the underlying asset never trades at or beyond the屏障。否则,PayoffValueis zero.

Data Types:char|cell|string

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"PayoffTypeis supported.

Data Types:char|cell|string

用户定义的更多乐器名称,指定为逗号分隔对'Name'and a scalar string or character vector or anNinst-经过-1字符向量或字符串数​​组的单元格数组。

Data Types:char|cell|string

Properties

expand all

期权锻炼日期,返回为标量日期或Ninst-经过-1数据矢量。

Data Types:datetime

Barrier level, returned as a scalar numeric or anNinst-经过-1numeric vector.

Data Types:双倍的

期权收益,返回为标量数字或Ninst-经过-1numeric vector.

Data Types:双倍的

Barrier type, returned as a scalar string or anNinst-经过-1string array.

Data Types:string

Option type, returned as a scalar string or anNinst-经过-1string array.

Data Types:string

User-defined name for the instrument, returned as a scalar string or anNinst-经过-1string array.

Data Types:string

例子

collapse all

此示例显示了工作流程的价格触碰instrument when you use aBlackScholesmodel and anAssetMonteCarlopricing method.

Create触碰Instrument Object

UseFinInstrumentto 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模型对象

Usefinmodelto create aBlackScholesmodel object.

BlackScholesModel = finmodel(“黑色”,'Volatility',.2)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2000 Correlation: 1

Createratecurve目的

Create a flatratecurveobject 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"

CreateAssetMonteCarloPricer Object

UseFinpricerto create anAssetMonteCarlo价格r object and use theratecurveobject 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很多

此示例显示了工作流程的价格多个触碰当你使用工具BlackScholesmodel and aBlackScholespricing method.

Create触碰Instrument Object

UseFinInstrumentto 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模型对象

Usefinmodelto create aBlackScholesmodel object.

BlackScholesModel = finmodel(“黑色”,'Volatility',0.28)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2800 Correlation: 1

Createratecurve目的

Create a flatratecurveobject 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"

CreateBlackScholesPricer Object

UseFinpricerto create aBlackScholes价格r object and use theratecurveobject 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

此示例显示了工作流程的价格触碰instrument when you use aHestonmodel and anAssetMonteCarlopricing method.

Create触碰Instrument Object

UseFinInstrumentto 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模型对象

Usefinmodelto create aHestonmodel 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 flatratecurveobject 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"

CreateAssetMonteCarloPricer Object

UseFinpricerto create anAssetMonteCarlo价格r object and use theratecurveobject 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

此示例显示了工作流程的价格触碰instrument when you use aBlackScholesmodel and aBlackScholespricing method.

Create触碰Instrument Object

UseFinInstrumentto 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模型对象

Usefinmodelto create aBlackScholesmodel object.

BlackScholesModel = finmodel(“黑色”,'Volatility',0.28)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2800 Correlation: 1

Createratecurve目的

Create a flatratecurveobject 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"

CreateBlackScholesPricer Object

UseFinpricerto create aBlackScholes价格r object and use theratecurveobject 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

expand all

Version History

Introduced in R2020b