Main Content

Touch

Touch instrument object

Since R2020b

Description

Create and price a Touch instrument object for one or more Touch instruments using this workflow:

  1. Use fininstrument to create a Touch instrument object for one or more Touch instruments.

  2. Use finmodel to specify a BlackScholes, Bates, Merton, or Heston model for the Touch instrument object.

  3. Choose a pricing method.

    • When using a BlackScholes model, use finpricer to specify a BlackScholes or a VannaVolga pricing method for one or more Barrier instruments.

    • When using a BlackScholes, Heston, Bates, or Merton model, use finpricer to specify an AssetMonteCarlo pricing method for one or more Touch 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 Touch instrument, see Choose Instruments, Models, and Pricers.

Creation

Description

TouchOpt = fininstrument(InstrumentType,'ExerciseDate',exercise_date,'BarrierValue',barrier_value,'PayoffValue',payoff_value) creates a Touch instrument object for one or more Touch instruments by specifying InstrumentType and sets properties using the required name-value pair arguments ExerciseDate, BarrierValue, and PayoffValue.

example

TouchOpt = fininstrument(___,Name,Value) sets optional properties using additional name-value pair arguments in addition to the required arguments in the previous syntax. For example, TouchOpt = fininstrument("Touch",'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'PayoffValue',130,'BarrierType',"OT",'PayoffType',"Expiry",'Name',"Touch_option") creates a Touch option with an expiry payoff type. You can specify multiple name-value pair arguments.

example

Input Arguments

expand all

Instrument type, specified as a string with the value of "Touch", a character vector with the value of 'Touch', an NINST-by-1 string array with values of "Touch", or an NINST-by-1 cell array of character vectors with values of 'Touch'.

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: TouchOpt = fininstrument("Touch",'ExerciseDate',datetime(2019,1,30),'BarrierValue',110,'PayoffValue',130,'BarrierType',"OT",'PayoffType',"Expiry",'Name',"Touch_option")

Required Touch Name-Value Pair Arguments

expand all

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, Touch 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.

Barrier level, specified as the comma-separated pair consisting of 'BarrierValue' and a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Option payoff value, specified as the comma-separated pair consisting of 'PayoffValue' and a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Optional Touch 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 an NINST-by-1 cell array 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 BarrierValue. Otherwise, the PayoffValue is zero.

  • 'NT' — No-touch

    The no-touch option provides a payoff if the underlying asset never trades at or beyond the BarrierValue. Otherwise, the PayoffValue is 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 an NINST-by-1 cell array of character vectors or string array. You can specify "Expiry" only when you specify 'OT' as the BarrierType.

Note

When you use a BlackScholes pricer, only the "Hit" PayoffType is supported.

Data Types: char | cell | string

User-defined name for one of more instruments, 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

expand all

Option exercise date, returned as a scalar datetime or an NINST-by-1 vector of datetimes.

Data Types: datetime

Barrier level, returned as a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Option payoff, returned as a scalar numeric or an NINST-by-1 numeric vector.

Data Types: double

Barrier type, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Option type, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

User-defined name for the instrument, returned as a scalar string or an NINST-by-1 string array.

Data Types: string

Examples

collapse all

This example shows the workflow to price a Touch instrument when you use a BlackScholes model and an AssetMonteCarlo pricing method.

Create Touch Instrument Object

Use fininstrument to create a Touch instrument object.

TouchOpt = fininstrument("Touch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',100,'PayoffValue',110,'BarrierType',"OT",'Name',"touch_option")
TouchOpt = 
  Touch with properties:

    ExerciseDate: 15-Sep-2022
    BarrierValue: 100
     PayoffValue: 110
     BarrierType: "ot"
      PayoffType: "expiry"
            Name: "touch_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 Touch Instrument

Use price to compute the price and sensitivities for the Touch instrument.

[Price, outPR] = price(outPricer,TouchOpt,["all"])
Price = 
91.1862
outPR = 
  priceresult with properties:

       Results: [1x7 table]
    PricerData: [1x1 struct]

outPR.Results 
ans=1×7 table
    Price      Delta      Gamma      Lambda       Rho      Theta      Vega 
    ______    _______    ________    _______    _______    ______    ______

    91.186    -2.1825    0.038281    -2.4413    -415.45    2.7374    35.998

This example shows the workflow to price a Touch instrument when you use a BlackScholes model and an AssetMonteCarlo pricing method with quasi-Monte Carlo simulation.

Create Touch Instrument Object

Use fininstrument to create a Touch instrument object.

TouchOpt = fininstrument("Touch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',100,'PayoffValue',110,'BarrierType',"OT",'Name',"touch_option")
TouchOpt = 
  Touch with properties:

    ExerciseDate: 15-Sep-2022
    BarrierValue: 100
     PayoffValue: 110
     BarrierType: "ot"
      PayoffType: "expiry"
            Name: "touch_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 Touch Instrument

Use price to compute the price and sensitivities for the Touch instrument.

[Price, outPR] = price(outPricer,TouchOpt,"all")
Price = 
91.1570
outPR = 
  priceresult with properties:

       Results: [1x7 table]
    PricerData: [1x1 struct]

outPR.Results 
ans=1×7 table
    Price      Delta      Gamma      Lambda       Rho      Theta      Vega 
    ______    _______    ________    _______    _______    ______    ______

    91.157    -2.1979    0.038396    -2.4594    -414.83    2.7317    36.009

This example shows the workflow to price multiple Touch instruments when you use a BlackScholes model and a BlackScholes pricing method.

Create Touch Instrument Object

Use fininstrument to create a Touch instrument object for three Touch instruments.

TouchOpt = fininstrument("Touch",'ExerciseDate',datetime([2022,9,15 ; 2022,10,15 ; 2022,11,15]),'BarrierValue',[140 ; 160 ; 190],'PayoffValue',170,'BarrierType',"OT",'Name',"touch_option")
TouchOpt=3×1 Touch 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',135,'DividendValue',0.045)
outPricer = 
  BlackScholes with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.BlackScholes]
        SpotPrice: 135
    DividendValue: 0.0450
     DividendType: "continuous"

Price Touch Instruments

Use price to compute the prices and sensitivities for the Touch instruments.

[Price, outPR] = price(outPricer,TouchOpt,["all"])
Price = 3×1

  136.5553
   99.8742
   63.6835

outPR=3×1 priceresult array with properties:
    Results
    PricerData

outPR.Results 
ans=1×7 table
    Price     Delta      Gamma      Lambda     Vega     Theta       Rho  
    ______    ______    ________    ______    ______    ______    _______

    136.56    2.2346    0.005457    2.2092    30.812    3.9013    -465.89

ans=1×7 table
    Price     Delta      Gamma      Lambda     Vega       Theta        Rho  
    ______    ______    ________    ______    ______    _________    _______

    99.874    1.8197    0.008319    2.4597    120.98    0.0043188    -138.47

ans=1×7 table
    Price     Delta       Gamma      Lambda     Vega      Theta      Rho  
    ______    ______    _________    ______    ______    _______    ______

    63.683    1.3221    0.0099462    2.8028    182.58    -3.0963    72.793

This example shows the workflow to price a Touch instrument when you use a Heston model and an AssetMonteCarlo pricing method.

Create Touch Instrument Object

Use fininstrument to create a Touch instrument object.

TouchOpt = fininstrument("Touch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',110,'PayoffValue',140,'BarrierType',"OT",'Name',"touch_option")
TouchOpt = 
  Touch with properties:

    ExerciseDate: 15-Sep-2022
    BarrierValue: 110
     PayoffValue: 140
     BarrierType: "ot"
      PayoffType: "expiry"
            Name: "touch_option"

Create Heston Model Object

Use finmodel to create a Heston 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

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",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
        MonteCarloMethod: "standard"
    BrownianMotionMethod: "standard"

Price Touch Instrument

Use price to compute the price and sensitivities for the Touch instrument.

[Price, outPR] = price(outPricer,TouchOpt,["all"])
Price = 
63.5247
outPR = 
  priceresult with properties:

       Results: [1x8 table]
    PricerData: [1x1 struct]

outPR.Results 
ans=1×8 table
    Price      Delta     Gamma     Lambda       Rho      Theta      Vega     VegaLT
    ______    _______    ______    _______    _______    ______    ______    ______

    63.525    -7.2363    1.0541    -12.758    -320.21    3.5527    418.94    8.1498

This example shows the workflow to price a Touch instrument when you use a BlackScholes model and a BlackScholes pricing method.

Create Touch Instrument Object

Use fininstrument to create a Touch instrument object.

TouchOpt = fininstrument("Touch",'ExerciseDate',datetime(2022,9,15),'BarrierValue',140,'PayoffValue',170,'BarrierType',"OT",'Name',"touch_option")
TouchOpt = 
  Touch with properties:

    ExerciseDate: 15-Sep-2022
    BarrierValue: 140
     PayoffValue: 170
     BarrierType: "ot"
      PayoffType: "expiry"
            Name: "touch_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',135,'DividendValue',0.045)
outPricer = 
  BlackScholes with properties:

    DiscountCurve: [1x1 ratecurve]
            Model: [1x1 finmodel.BlackScholes]
        SpotPrice: 135
    DividendValue: 0.0450
     DividendType: "continuous"

Price Touch Instrument

Use price to compute the price and sensitivities for the Touch instrument.

[Price, outPR] = price(outPricer,TouchOpt,["all"])
Price = 
136.5553
outPR = 
  priceresult with properties:

       Results: [1x7 table]
    PricerData: []

outPR.Results 
ans=1×7 table
    Price     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

expand all