DoubleTouch
DoubleTouch instrument object
Description
Create and price a DoubleTouch instrument object for one of
more Double Touch instruments using this workflow:
Use
fininstrumentto create aDoubleTouchinstrument object for one of more Double Touch instruments.Use
finmodelto specify aBlackScholes,Bates,Merton, orHestonmodel for theDoubleTouchinstrument object.Choose a pricing method.
When using a
BlackScholesmodel, usefinpricerto specify aBlackScholesorVannaVolgapricing method for one or moreDoubleTouchinstruments.When using a
BlackScholes,Heston,Bates, orMertonmodel, usefinpricerto specify anAssetMonteCarlopricing method for one or moreDoubleTouchinstruments.
For more information on this workflow, see Get Started with Workflows Using Object-Based Framework for Pricing Financial Instruments.
For more information on the available models and pricing methods for a
DoubleTouch instrument, see Choose Instruments, Models, and Pricers.
Creation
Syntax
Description
creates a DoubleTouchOpt = fininstrument(InstrumentType,'ExerciseDate',exercise_date,'BarrierValue',barrier_value,'PayoffValue',payoff_value)DoubleTouch object for one of more Double Touch
instruments by specifying InstrumentType and sets properties using
the required name-value pair arguments ExerciseDate,
BarrierValue, and
PayoffValue.
sets optional properties using
additional name-value pair arguments in addition to the required arguments
in the previous syntax. For example, DoubleTouchOpt = fininstrument(___,Name,Value)DoubleTouchOpt =
fininstrument("DoubleTouch",'Strike',100,'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'PayoffValue',150,'BarrierType',"DOT",'PayoffType',"Expiry",'Name',"DoubleTouch_option")
creates a DoubleTouch option with a payoff type of
Expiry. You can specify multiple name-value pair
arguments.
Input Arguments
Instrument type, specified as a string with the value of
"DoubleTouch", a character vector with the value
of 'DoubleTouch', an
NINST-by-1 string array with
values of "DoubleTouch", or an
NINST-by-1 cell array of
character vectors with values of
'DoubleTouch'.
Data Types: char | cell | string
Name-Value Arguments
Specify required
and optional pairs of arguments as
Name1=Value1,...,NameN=ValueN, where
Name is the argument name and Value is
the corresponding value. Name-value 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: DoubleTouchOpt =
fininstrument("DoubleTouch",'Strike',100,'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'OptionType',"put",'ExerciseStyle',"European",'BarrierType',"DO",'Name',"DoubleTouch_option")
Required DoubleTouch Name-Value Pair Arguments
Option exercise date, specified as the comma-separated pair
consisting of 'ExerciseDate' and a scalar or an
NINST-by-1 vector using a
datetime array, string array, or date character vectors.
To support existing code, DoubleTouch also
accepts serial date numbers as inputs, but they are not recommended.
If you use date character vectors or strings, the format must be
recognizable by datetime because
the ExerciseDate property is stored as a
datetime.
Option barrier levels, specified as the comma-separated pair
consisting of 'BarrierValue' and an
NINST-by-2 matrix of
numeric values, where the first column is Upper Barrier(1)(UB) and
the second column is Lower Barrier(2)(LB). Barrier(1) must be
greater than Barrier(2).
Data Types: double
Payoff value, specified as the comma-separated pair consisting of
'PayoffValue' and an
NINST-by-1 matrix of
numeric values, where each element is a
1-by-2 vector in which the
first column is Barrier(1)(UB) and the second column is
Barrier(2)(LB). Barrier(1) must be greater than Barrier(2).
Note
The payoff value is calculated for the point in time that
the BarrierValue is reached. The payoff
is either cash or nothing. If you specify a double no-touch
option using BarrierType, the payoff is
at the maturity of the option.
Data Types: double
Optional DoubleTouch Name-Value Pair Arguments
Double barrier type, specified as the comma-separated pair
consisting of 'BarrierType' and a string or
character vector or an
NINST-by-1 cell array of
character vectors or string array with one of the following values:
'DOT'— Double one-touch. The double one-touch option defines twoBarrierValuevalues. A double one-touch option provides aPayoffValueif the underlying asset ever touches either the upper or lowerBarrierValuevalues.'DNT'— Double no-touch. The double no-touch option defines twoBarrierValuevalues. A double no-touch option provides aPayoffValueif the underlying asset ever never touches either the upper or lowerBarrierValuevalues.'UNT-LOT'— UpperBarrierValueis No Touch and LowerBarrierValueis one Touch.'UOT-LNT'— UpperBarrierValueis One Touch and LowerBarrierValueis No Touch.
Data Types: char | cell | string
Payoff type, specified as the comma-separated pair consisting of
'PayoffType' and a scalar string or character
vector or an NINST-by-1 cell
array of character vectors or string array. You cannot use specify
"Expiry" when using a
BarrierType of 'DNT'.
Note
When you use a BlackScholes pricer, only the
"Expiry"
PayoffType is supported.
Data Types: char | cell | string
User-defined name for the instrument, specified as the
comma-separated pair consisting of 'Name' and a
scalar string or character vector or an
NINST-by-1 cell array of
character vectors or string array.
Data Types: char | cell | string
Output Arguments
Double Touch instrument, returned as a DoubleTouch
object.
Properties
Option exercise date, returned as a datetime or an
NINST-by-1 vector of
datetimes.
Data Types: datetime
Barrier level, returned as a numeric matrix.
Data Types: double
Option payoff, returned as a numeric matrix.
Data Types: double
Double barrier type, returned as a scalar string or an
NINST-by-1 string array.
Data Types: string
Option type, returned as a string or an
NINST-by-1 string array.
Data Types: string
User-defined name for the instrument, returned as a string or an
NINST-by-1 string array.
Data Types: string
Examples
This example shows the workflow to price a DoubleTouch instrument when you use a BlackScholes model and an AssetMonteCarlo pricing method.
Create DoubleTouch Instrument Object
Use fininstrument to create a DoubleTouch instrument object.
DoubleTouchOpt = fininstrument("DoubleTouch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',[110 90],'PayoffValue',50,'BarrierType',"DOT",'Name',"doubletouch_option")
DoubleTouchOpt =
DoubleTouch with properties:
ExerciseDate: 15-Sep-2022
BarrierValue: [110 90]
PayoffValue: 50
BarrierType: "dot"
PayoffType: "expiry"
Name: "doubletouch_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object.
BlackScholesModel = finmodel("BlackScholes",'Volatility',.2)
BlackScholesModel =
BlackScholes with properties:
Volatility: 0.2000
Correlation: 1
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',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"
Create AssetMonteCarlo Pricer Object
Use finpricer to create an AssetMonteCarlo pricer object and use the ratecurve 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: [1×1 ratecurve]
SpotPrice: 102
SimulationDates: 15-Sep-2022
NumTrials: 1000
RandomNumbers: []
Model: [1×1 finmodel.BlackScholes]
DividendType: "continuous"
DividendValue: 0
MonteCarloMethod: "standard"
BrownianMotionMethod: "standard"
Price DoubleTouch Instrument
Use price to compute the price and sensitivities for the DoubleTouch instrument.
[Price, outPR] = price(outPricer,DoubleTouchOpt,["all"])Price = 43.3860
outPR =
priceresult with properties:
Results: [1×7 table]
PricerData: [1×1 struct]
outPR.Results
ans=1×7 table
Price Delta Gamma Lambda Rho Theta Vega
______ _________ _________ ________ _______ ______ ______
43.386 0.0043916 0.0018346 0.010325 -173.28 1.4722 1.8176
This example shows the workflow to price a DoubleTouch instrument when you use a BlackScholes model and an AssetMonteCarlo pricing method with quasi-Monte Carlo simulation.
Create DoubleTouch Instrument Object
Use fininstrument to create a DoubleTouch instrument object.
DoubleTouchOpt = fininstrument("DoubleTouch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',[110 90],'PayoffValue',50,'BarrierType',"DOT",'Name',"doubletouch_option")
DoubleTouchOpt =
DoubleTouch with properties:
ExerciseDate: 15-Sep-2022
BarrierValue: [110 90]
PayoffValue: 50
BarrierType: "dot"
PayoffType: "expiry"
Name: "doubletouch_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object.
BlackScholesModel = finmodel("BlackScholes",'Volatility',.2)
BlackScholesModel =
BlackScholes with properties:
Volatility: 0.2000
Correlation: 1
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',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"
Create AssetMonteCarlo Pricer Object
Use finpricer to create an AssetMonteCarlo pricer object and use the ratecurve object for the 'DiscountCurve' name-value argument and use the name-value arguments for MonteCarloMethod and BrownianMotionMethod.
outPricer = finpricer("AssetMonteCarlo",'DiscountCurve',myRC,"Model",BlackScholesModel,'SpotPrice',102,'simulationDates',datetime(2022,9,15),'NumTrials',1e3, ... 'MonteCarloMethod',"quasi",'BrownianMotionMethod',"brownian-bridge")
outPricer =
GBMMonteCarlo with properties:
DiscountCurve: [1×1 ratecurve]
SpotPrice: 102
SimulationDates: 15-Sep-2022
NumTrials: 1000
RandomNumbers: []
Model: [1×1 finmodel.BlackScholes]
DividendType: "continuous"
DividendValue: 0
MonteCarloMethod: "quasi"
BrownianMotionMethod: "brownian-bridge"
Price DoubleTouch Instrument
Use price to compute the price and sensitivities for the DoubleTouch instrument.
[Price, outPR] = price(outPricer,DoubleTouchOpt,"all")Price = 43.3940
outPR =
priceresult with properties:
Results: [1×7 table]
PricerData: [1×1 struct]
outPR.Results
ans=1×7 table
Price Delta Gamma Lambda Rho Theta Vega
______ _________ _________ _________ ______ ______ ______
43.394 0.0041456 0.0014145 0.0097445 -173.4 1.4757 1.7037
This example shows the workflow to price multiple DoubleTouch instruments when you use a BlackScholes model and a BlackScholes pricing method.
Create DoubleTouch Instrument Object
Use fininstrument to create a DoubleTouch instrument object for three Double Touch instruments.
DoubleTouchOpt = fininstrument("DoubleTouch",'ExerciseDate',datetime([2022,9,15 ; 2022,10,15 ; 2022,11,15]),'BarrierValue',[115 95],'PayoffValue',[70 ; 89 ; 90],'BarrierType',"UNT-LOT",'Name',"doubletouch_option")
DoubleTouchOpt=3×1 DoubleTouch array with properties:
ExerciseDate
BarrierValue
PayoffValue
BarrierType
PayoffType
Name
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object.
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.28)
BlackScholesModel =
BlackScholes with properties:
Volatility: 0.2800
Correlation: 1
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',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"
Create BlackScholes Pricer Object
Use finpricer to create a BlackScholes pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("analytic",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',100,'DividendValue',0.045)
outPricer =
BlackScholes with properties:
DiscountCurve: [1×1 ratecurve]
Model: [1×1 finmodel.BlackScholes]
SpotPrice: 100
DividendValue: 0.0450
DividendType: "continuous"
Price DoubleTouch Instruments
Use price to compute the prices and sensitivities for the DoubleTouch instruments.
[Price, outPR] = price(outPricer,DoubleTouchOpt,["all"])Price = 3×1
52.6903
66.9920
67.7447
outPR=3×1 priceresult array with properties:
Results
PricerData
outPR.Results
ans=1×7 table
Price Delta Gamma Lambda Vega Theta Rho
_____ _______ __________ _______ _______ _____ _______
52.69 -3.4708 -0.0041339 -6.5871 -1.3469 0 -35.883
ans=1×7 table
Price Delta Gamma Lambda Vega Theta Rho
______ _______ _________ _______ _______ _____ _______
66.992 -4.4128 -0.005258 -6.5871 -1.7125 0 -45.623
ans=1×7 table
Price Delta Gamma Lambda Vega Theta Rho
______ _______ __________ _______ _______ _____ _______
67.745 -4.4624 -0.0053149 -6.5871 -1.7318 0 -46.135
This example shows the workflow to price a DoubleTouch instrument when you use a Bates model and an AssetMonteCarlo pricing method.
Create DoubleTouch Instrument Object
Use fininstrument to create a DoubleTouch instrument object.
DoubleTouchOpt = fininstrument("DoubleTouch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',[115 95],'PayoffValue',40,'BarrierType',"DOT",'Name',"doubletouch_option")
DoubleTouchOpt =
DoubleTouch with properties:
ExerciseDate: 15-Sep-2022
BarrierValue: [115 95]
PayoffValue: 40
BarrierType: "dot"
PayoffType: "expiry"
Name: "doubletouch_option"
Create Bates Model Object
Use finmodel to create a Bates model object.
BatesModel = finmodel("Bates",'V0',0.032,'ThetaV',0.1,'Kappa',0.003,'SigmaV',0.2,'RhoSV',0.9,'MeanJ',0.11,'JumpVol',.023,'JumpFreq',0.02)
BatesModel =
Bates with properties:
V0: 0.0320
ThetaV: 0.1000
Kappa: 0.0030
SigmaV: 0.2000
RhoSV: 0.9000
MeanJ: 0.1100
JumpVol: 0.0230
JumpFreq: 0.0200
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',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"
Create AssetMonteCarlo Pricer Object
Use finpricer to create an AssetMonteCarlo pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("AssetMonteCarlo",'DiscountCurve',myRC,"Model",BatesModel,'SpotPrice',102,'simulationDates',datetime(2022,9,15))
outPricer =
BatesMonteCarlo with properties:
DiscountCurve: [1×1 ratecurve]
SpotPrice: 102
SimulationDates: 15-Sep-2022
NumTrials: 1000
RandomNumbers: []
Model: [1×1 finmodel.Bates]
DividendType: "continuous"
DividendValue: 0
MonteCarloMethod: "standard"
BrownianMotionMethod: "standard"
Price DoubleTouch Instrument
Use price to compute the price and sensitivities for the DoubleTouch instrument.
[Price, outPR] = price(outPricer,DoubleTouchOpt,["all"])Price = 34.7743
outPR =
priceresult with properties:
Results: [1×8 table]
PricerData: [1×1 struct]
outPR.Results
ans=1×8 table
Price Delta Gamma Lambda Rho Theta Vega VegaLT
______ _____ _____ ______ _______ ______ ____ ______
34.774 0 0 0 -139.07 1.2179 0 0
This example shows the workflow to price a DoubleTouch instrument when you use a BlackScholes model and a BlackScholes pricing method.
Create DoubleTouch Instrument Object
Use fininstrument to create a DoubleTouch instrument object.
DoubleTouchOpt = fininstrument("DoubleTouch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',[115 95],'PayoffValue',70,'BarrierType',"UNT-LOT",'Name',"doubletouch_option")
DoubleTouchOpt =
DoubleTouch with properties:
ExerciseDate: 15-Sep-2022
BarrierValue: [115 95]
PayoffValue: 70
BarrierType: "unt-lot"
PayoffType: "expiry"
Name: "doubletouch_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object.
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.28)
BlackScholesModel =
BlackScholes with properties:
Volatility: 0.2800
Correlation: 1
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',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"
Create BlackScholes Pricer Object
Use finpricer to create a BlackScholes pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("analytic",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',100,'DividendValue',0.045)
outPricer =
BlackScholes with properties:
DiscountCurve: [1×1 ratecurve]
Model: [1×1 finmodel.BlackScholes]
SpotPrice: 100
DividendValue: 0.0450
DividendType: "continuous"
Price DoubleTouch Instrument
Use price to compute the price and sensitivities for the DoubleTouch instrument.
[Price, outPR] = price(outPricer,DoubleTouchOpt,["all"])Price = 52.6903
outPR =
priceresult with properties:
Results: [1×7 table]
PricerData: []
outPR.Results
ans=1×7 table
Price Delta Gamma Lambda Vega Theta Rho
_____ _______ __________ _______ _______ _____ _______
52.69 -3.4708 -0.0041339 -6.5871 -1.3469 0 -35.883
More About
Double touch and double
no-touch options work the same way as a Touch option, but
have two barriers.
A double touch option is based on an underlying asset, such as a stock, currency pair, commodity, or market index. The option's value is derived from the price movement of the underlying asset. A double touch option has two barrier levels, an upper barrier and a lower barrier.
Double touch and double no-touch option provides a payoff if the underlying spot ever (never) touches either the upper or lower barriers levels. For more information, see One-Touch and Double One-Touch Options.
Version History
Introduced in R2020bAlthough DoubleTouch 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.
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)