DoubleTouch
Description
Create and price a DoubleTouch
instrument object for one of
more Double Touch instruments using this workflow:
Use
fininstrument
to create aDoubleTouch
instrument object for one of more Double Touch instruments.Use
finmodel
to specify aBlackScholes
,Bates
,Merton
, orHeston
model for theDoubleTouch
instrument object.Choose a pricing method.
When using a
BlackScholes
model, usefinpricer
to specify aBlackScholes
orVannaVolga
pricing method for one or moreDoubleTouch
instruments.When using a
BlackScholes
,Heston
,Bates
, orMerton
model, usefinpricer
to specify anAssetMonteCarlo
pricing method for one or moreDoubleTouch
instruments.
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
InstrumentType
— Instrument type
string with value "DoubleTouch"
| string array with values of "DoubleTouch"
| character vector with value 'DoubleTouch'
| cell array of character vectors with values of
'DoubleTouch'
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
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")
DoubleTouch
Name-Value Pair ArgumentsExerciseDate
— Option exercise date
datetime array | string array | date character vector
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.
BarrierValue
— Option barrier levels
numeric
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
PayoffValue
— Payoff value
numeric
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
DoubleTouch
Name-Value Pair ArgumentsBarrierType
— Double barrier type
"DOT"
(default) | string with value "DOT"
,
"DNT"
, "UNT-LOT"
, or
"UOT-LNT"
| string array with values "DOT"
,
"DNT"
, "UNT-LOT"
, or
"UOT-LNT"
| character vector with value 'DOT'
,
'DNT'
, 'UNT-LOT'
, or
'UOT-LNT'
| cell array of character vectors with values
'DOT'
, 'DNT'
,
'UNT-LOT'
, or
'UOT-LNT'
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 twoBarrierValue
values. A double one-touch option provides aPayoffValue
if the underlying asset ever touches either the upper or lowerBarrierValue
values.'DNT'
— Double no-touch. The double no-touch option defines twoBarrierValue
values. A double no-touch option provides aPayoffValue
if the underlying asset ever never touches either the upper or lowerBarrierValue
values.'UNT-LOT'
— UpperBarrierValue
is No Touch and LowerBarrierValue
is one Touch.'UOT-LNT'
— UpperBarrierValue
is One Touch and LowerBarrierValue
is No Touch.
Data Types: char
| cell
| string
PayoffType
— Payoff type
"Hit"
(default) | string with value "Hit"
or
"Expiry"
| string arrays with values "Hit"
or
"Expiry"
| character vector with value 'Hit'
or
'Expiry'
| cell array of character vectors with values
'Hit'
or 'Expiry'
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
Name
— User-defined name for instrument
" "
(default) | string | string array | character vector | cell array of character vectors
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
Properties
ExerciseDate
— Option exercise date
datetime | vector of datetimes
Option exercise date, returned as a datetime or an
NINST
-by-1
vector of
datetimes.
Data Types: datetime
BarrierValue
— Barrier level
numeric
Barrier level, returned as a numeric matrix.
Data Types: double
PayoffValue
— Option payoff
numeric
Option payoff, returned as a numeric matrix.
Data Types: double
BarrierType
— Double barrier type
"DOT"
(default) | string with value "DOT"
, "DNT"
,
"UNT-LOT"
, or "UOT-LNT"
| string array with values "DOT"
,
"DNT"
, "UNT-LOT"
, or
"UOT-LNT"
Double barrier type, returned as a scalar string or an
NINST
-by-1
string array.
Data Types: string
PayoffType
— Payoff type
"Hit"
(default) | string with value "Hit"
or
"Expiry"
| string array with values "Hit"
or
"Expiry"
Option type, returned as a string or an
NINST
-by-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 string or an
NINST
-by-1
string array.
Data Types: string
Examples
Price DoubleTouch
Instrument Using BlackScholes
Model and AssetMonteCarlo
Pricer
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: [1x1 ratecurve] SpotPrice: 102 SimulationDates: 15-Sep-2022 NumTrials: 1000 RandomNumbers: [] Model: [1x1 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: [1x7 table] PricerData: [1x1 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
Price DoubleTouch
Instrument Using BlackScholes
Model and AssetMonteCarlo
Pricer with Quasi-Monte Carlo Simulation
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: [1x1 ratecurve] SpotPrice: 102 SimulationDates: 15-Sep-2022 NumTrials: 1000 RandomNumbers: [] Model: [1x1 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: [1x7 table] PricerData: [1x1 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
Price Multiple DoubleTouch
Instruments Using BlackScholes
Model and BlackScholes
Pricer
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: [1x1 ratecurve] Model: [1x1 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
Price DoubleTouch
Instrument Using Bates
Model and AssetMonteCarlo
Pricer
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: [1x1 ratecurve] SpotPrice: 102 SimulationDates: 15-Sep-2022 NumTrials: 1000 RandomNumbers: [] Model: [1x1 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: [1x8 table] PricerData: [1x1 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
Price DoubleTouch
Instrument Using BlackScholes
Model and BlackScholes
Pricer
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: [1x1 ratecurve] Model: [1x1 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: [1x7 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 Option
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 R2020bR2022b: Serial date numbers not recommended
Although 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.
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
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érica Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)