Lookback
Lookback instrument
Description
Create and price a Lookback instrument object for one or
            more Lookback instruments using this workflow:
- Use - fininstrumentto create a- Lookbackinstrument object for one or more Lookback instruments.
- Use - finmodelto specify a- BlackScholes,- Heston,- Bates, or- Mertonmodel for the- Lookbackinstrument object.
- Choose a pricing method. - When using a - BlackScholesmodel, use- finpricerto specify a- ConzeViswanathan,- AssetTree, or- GoldmanSosinGattopricing method for one or more- Lookbackinstruments.
- When using a - BlackScholes,- Heston,- Bates, or- Mertonmodel, use- finpricerto specify an- AssetMonteCarlopricing method for one or more- Lookbackinstruments.
 
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
                Lookback instrument, see Choose Instruments, Models, and Pricers.
Creation
Syntax
Description
LookbackObj = fininstrument(InstrumentType,'Strike',strike_value,'ExerciseDate',exercise_date)Lookback object for one or more Lookback
                        instruments by specifying InstrumentType and sets the
                            properties for the
                        required name-value pair arguments Strike and
                            ExerciseDate. 
The Lookback instrument supports fixed-strike and
                        floating-strike lookback options. For more information on a
                            Lookback instrument, see More About.
LookbackObj = fininstrument(___,Name,Value)LookbackObj =
                            fininstrument("Lookback",'Strike',100,'ExerciseDate',datetime(2019,1,30),'OptionType',"put",'ExerciseStyle',"European",'Name',"lookback_option")
                        creates a Lookback put option with an European exercise.
                        You can specify multiple name-value pair arguments.
Input Arguments
Instrument type, specified as a string with the value of
                                "Lookback", a character vector with the value of
                                'Lookback', an
                                NINST-by-1 string array with
                            values "Lookback", or an
                                NINST-by-1 cell array of
                            character vectors with values of 'Lookback'. 
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: LookbackObj =
                        fininstrument("Lookback",'Strike',100,'ExerciseDate',datetime(2019,1,30),'OptionType',"put",'ExerciseStyle',"European",'Name',"lookback_option")
Required Lookback Name-Value Pair Arguments
Option strike price value, specified as the comma-separated pair
                                consisting of 'Strike' and a scalar nonnegative
                                numeric value or an NINST-by-1
                                vector of nonnegative values for a fixed-strike
                                    Lookback option. For a floating-strike
                                    Lookback option, specify
                                    'Strike' as a NaN or an
                                    NINST-by-1 vector of
                                    NaNs.
Note
Use the ConzeViswanathan pricer for a fixed strike
                                            Lookback option and use the GoldmanSosinGatto pricer for a floating strike
                                            Lookback option.
Data Types: double
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.
Note
For a European option, there is only one
                                            ExerciseDate on the option expiry
                                        date.
To support existing code, Lookback 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.
Optional Lookback Name-Value Pair Arguments
Option type, specified as the comma-separated pair consisting of
                                    'OptionType' and a scalar string or character
                                vector or an NINST-by-1 cell
                                array of character vectors or string array.
A lookback call option gives the holder the right to buy the underlying asset at the highest price observed during the option's term. This allows the holder to benefit from the highest possible purchase price.
A lookback put option provides the holder with the right to sell the underlying asset at the lowest price observed during the option's term. This allows the holder to take advantage of the lowest possible selling price.
Data Types: char | cell | string
Option exercise style, specified as the comma-separated pair
                                consisting of 'ExerciseStyle' and a scalar string
                                or character vector or an
                                    NINST-by-1 cell array of
                                character vectors or string array.
Lookback options can be either European-style or American-style, depending on when they can be exercised:
- European Lookback Option — This type of lookback option can only be exercised at the expiration date. 
- American Lookback Option — An American-style lookback option allows the holder to exercise the option at any time during the option's term. 
Data Types: string | cell | char
Maximum or minimum underlying asset price, specified as the
                                comma-separated pair consisting of 'AssetMinMax'
                                and a scalar numeric or an
                                    NINST-by-1 numeric
                                vector.
Data Types: double
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
Output Arguments
Lookback instrument, returned as a Lookback
                            object.
Properties
Option strike price value, returned as a scalar nonnegative numeric or an
                            NINST-by-1 vector of nonnegative
                        values. 
Data Types: double
Option exercise date, returned as a datetime or an
                            NINST-by-1 vector of
                        datetimes.
Data Types: datetime
Option type, returned as a scalar string or an
                            NINST-by-1 string array with the
                        values of "call" or "put".
Data Types: string
Option exercise style, returned as a scalar string or an
                            NINST-by-1 string array with
                        values of "European" or "American". 
Data Types: string
Maximum or minimum underlying asset price, returned as a scalar numeric or
                        an NINST-by-1 numeric vector.
Data Types: double
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 LookBack instrument when you use a BlackScholes model and a ConzeViswanathan pricing method.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object. 
LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:
       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object. 
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.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 ConzeViswanathan Pricer Object
Use finpricer to create a ConzeViswanathan pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("analytic","Model",BlackScholesModel,"DiscountCurve",myRC,"SpotPrice",100,"DividendValue",0.25,"DividendType","continuous","PricingMethod","ConzeViswanathan")
outPricer = 
  ConzeViswanathan with properties:
    DiscountCurve: [1×1 ratecurve]
            Model: [1×1 finmodel.BlackScholes]
        SpotPrice: 100
    DividendValue: 0.2500
     DividendType: "continuous"
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(outPricer,LookbackOpt,["all"])Price = 57.8786
outPR = 
  priceresult with properties:
       Results: [1×7 table]
    PricerData: []
outPR.Results
ans=1×7 table
    Price      Delta      Gamma     Lambda      Vega      Theta       Rho  
    ______    ________    _____    ________    ______    _______    _______
    57.879    -0.33404      0      -0.57714    32.587    -5.1863    -350.41
This example shows the workflow to price multiple LookBack instrument when you use a BlackScholes model and a ConzeViswanathan pricing method.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object for three Lookback instruments. 
LookbackOpt = fininstrument("Lookback",'Strike',[105 ; 120; 140],'ExerciseDate',datetime([2022,9,15 ; 2022,10,15 ; 2022,11,15]),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt=3×1 Lookback array with properties:
    OptionType
    Strike
    AssetMinMax
    ExerciseStyle
    ExerciseDate
    Name
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object. 
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.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 ConzeViswanathan Pricer Object
Use finpricer to create a ConzeViswanathan pricer object and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
outPricer = finpricer("analytic","Model",BlackScholesModel,"DiscountCurve",myRC,"SpotPrice",100,"DividendValue",0.25,"DividendType","continuous","PricingMethod","ConzeViswanathan")
outPricer = 
  ConzeViswanathan with properties:
    DiscountCurve: [1×1 ratecurve]
            Model: [1×1 finmodel.BlackScholes]
        SpotPrice: 100
    DividendValue: 0.2500
     DividendType: "continuous"
Price Lookback Instruments
Use price to compute the prices and sensitivities for the Lookback instruments.
[Price, outPR] = price(outPricer,LookbackOpt,["all"])Price = 3×1
   57.8786
   71.3008
   88.9673
outPR=3×1 priceresult array with properties:
    Results
    PricerData
outPR.Results
ans=1×7 table
    Price      Delta      Gamma     Lambda      Vega      Theta       Rho  
    ______    ________    _____    ________    ______    _______    _______
    57.879    -0.33404      0      -0.57714    32.587    -5.1863    -350.41
ans=1×7 table
    Price      Delta        Gamma        Lambda      Vega      Theta       Rho  
    ______    ________    __________    ________    ______    _______    _______
    71.301    -0.32722    2.8422e-06    -0.45894    31.997    -4.5677    -410.15
ans=1×7 table
    Price      Delta        Gamma        Lambda      Vega      Theta       Rho  
    ______    ________    __________    ________    ______    _______    _______
    88.967    -0.32033    1.4211e-06    -0.36005    31.395    -3.7989    -489.96
This example shows the workflow to price a LookBack instrument when you use an BlackScholes model and an AssetTree pricing method using a Leisen-Reimer (LR) binomial tree.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object. 
LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:
       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object. 
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.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 AssetTree Pricer Object
Use finpricer to create an AssetTree pricer object for a LR equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
NumPeriods = 15; LRPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',150,'PricingMethod',"LeisenReimer",'Maturity',datetime(2022,9,15),'NumPeriods',NumPeriods)
LRPricer = 
  LRTree with properties:
    InversionMethod: PP1
             Strike: 150
               Tree: [1×1 struct]
         NumPeriods: 15
              Model: [1×1 finmodel.BlackScholes]
      DiscountCurve: [1×1 ratecurve]
          SpotPrice: 150
       DividendType: "continuous"
      DividendValue: 0
          TreeDates: [21-Dec-2018 09:36:00    28-Mar-2019 19:12:00    04-Jul-2019 04:48:00    09-Oct-2019 14:24:00    15-Jan-2020 00:00:00    21-Apr-2020 09:36:00    27-Jul-2020 19:12:00    02-Nov-2020 04:48:00    …    ] (1×15 datetime)
LRPricer.Tree
ans = struct with fields:
    Probs: [2×15 double]
    ATree: {1×16 cell}
     dObs: [15-Sep-2018 00:00:00    21-Dec-2018 09:36:00    28-Mar-2019 19:12:00    04-Jul-2019 04:48:00    09-Oct-2019 14:24:00    15-Jan-2020 00:00:00    21-Apr-2020 09:36:00    27-Jul-2020 19:12:00    02-Nov-2020 04:48:00    …    ] (1×16 datetime)
     tObs: [0 0.2667 0.5333 0.8000 1.0667 1.3333 1.6000 1.8667 2.1333 2.4000 2.6667 2.9333 3.2000 3.4667 3.7333 4]
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(LRPricer,LookbackOpt,["all"])Price = 3.9412
outPR = 
  priceresult with properties:
       Results: [1×7 table]
    PricerData: []
outPR.Results
ans=1×7 table
    Price      Delta        Gamma       Vega     Lambda       Rho       Theta 
    ______    ________    _________    ______    _______    _______    _______
    3.9412    -0.13312    -0.011131    67.684    -5.0757    -73.857    -1.0383
This example shows the workflow to price a LookBack instrument when you use an BlackScholes model and an AssetTree pricing method using a Standard Trinomial (STT) tree.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object. 
LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:
       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object. 
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.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 AssetTree Pricer Object
Use finpricer to create an AssetTree pricer object for a Standard Trinomial (STT) equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
NumPeriods = 15; STTPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',150,'PricingMethod',"StandardTrinomial",'Maturity',datetime(2022,9,15),'NumPeriods',NumPeriods)
STTPricer = 
  STTree with properties:
             Tree: [1×1 struct]
       NumPeriods: 15
            Model: [1×1 finmodel.BlackScholes]
    DiscountCurve: [1×1 ratecurve]
        SpotPrice: 150
     DividendType: "continuous"
    DividendValue: 0
        TreeDates: [21-Dec-2018 09:36:00    28-Mar-2019 19:12:00    04-Jul-2019 04:48:00    09-Oct-2019 14:24:00    15-Jan-2020 00:00:00    21-Apr-2020 09:36:00    27-Jul-2020 19:12:00    02-Nov-2020 04:48:00    …    ] (1×15 datetime)
STTPricer.Tree
ans = struct with fields:
    ATree: {1×16 cell}
    Probs: {[3×1 double]  [3×3 double]  [3×5 double]  [3×7 double]  [3×9 double]  [3×11 double]  [3×13 double]  [3×15 double]  [3×17 double]  [3×19 double]  [3×21 double]  [3×23 double]  [3×25 double]  [3×27 double]  [3×29 double]}
     dObs: [15-Sep-2018 00:00:00    21-Dec-2018 09:36:00    28-Mar-2019 19:12:00    04-Jul-2019 04:48:00    09-Oct-2019 14:24:00    15-Jan-2020 00:00:00    21-Apr-2020 09:36:00    27-Jul-2020 19:12:00    02-Nov-2020 04:48:00    …    ] (1×16 datetime)
     tObs: [0 0.2667 0.5333 0.8000 1.0667 1.3333 1.6000 1.8667 2.1333 2.4000 2.6667 2.9333 3.2000 3.4667 3.7333 4]
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(STTPricer,LookbackOpt,["all"])Price = 3.3392
outPR = 
  priceresult with properties:
       Results: [1×7 table]
    PricerData: []
outPR.Results
ans=1×7 table
    Price      Delta         Gamma        Vega     Lambda       Rho       Theta 
    ______    ________    ___________    ______    _______    _______    _______
    3.3392    -0.15942    -1.0596e-11    63.886    -7.1613    -68.263    -1.0254
This example shows the workflow to price a LookBack instrument when you use a BlackScholes model and an AssetMonetCarlo pricing method.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object. 
LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:
       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object. 
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.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',200,'simulationDates',datetime(2022,9,15))
outPricer = 
  GBMMonteCarlo with properties:
           DiscountCurve: [1×1 ratecurve]
               SpotPrice: 200
         SimulationDates: 15-Sep-2022
               NumTrials: 1000
           RandomNumbers: []
                   Model: [1×1 finmodel.BlackScholes]
            DividendType: "continuous"
           DividendValue: 0
        MonteCarloMethod: "standard"
    BrownianMotionMethod: "standard"
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(outPricer,LookbackOpt,["all"])Price = 1.8553
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 
    ______    _________    __________    _______    _______    ________    ______
    1.8553    -0.040442    0.00062792    -4.3596    -39.426    -0.71345    42.311
This example shows the workflow to price a LookBack instrument when you use a BlackScholes model and an AssetMonetCarlo pricing method with quasi-Monte Carlo simulation.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object. 
LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:
       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object. 
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.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',200,'simulationDates',datetime(2022,9,15),'NumTrials',1e3, ... 'MonteCarloMethod',"quasi",'BrownianMotionMethod',"brownian-bridge")
outPricer = 
  GBMMonteCarlo with properties:
           DiscountCurve: [1×1 ratecurve]
               SpotPrice: 200
         SimulationDates: 15-Sep-2022
               NumTrials: 1000
           RandomNumbers: []
                   Model: [1×1 finmodel.BlackScholes]
            DividendType: "continuous"
           DividendValue: 0
        MonteCarloMethod: "quasi"
    BrownianMotionMethod: "brownian-bridge"
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(outPricer,LookbackOpt,"all")Price = 1.8493
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 
    ______    _________    _________    _______    _______    ________    ______
    1.8493    -0.045633    0.0011617    -4.9352    -43.807    -0.79718    47.192
This example shows the workflow to price a LookBack instrument when you use a Bates model and an AssetMonetCarlo pricing method.  
Create Lookback Instrument Object
Use fininstrument to create a Lookback instrument object. 
LookbackOpt = fininstrument("Lookback",'Strike',105,'ExerciseDate',datetime(2022,9,15),'OptionType',"put",'ExerciseStyle',"european",'Name',"lookback_option")
LookbackOpt = 
  Lookback with properties:
       OptionType: "put"
           Strike: 105
      AssetMinMax: NaN
    ExerciseStyle: "european"
     ExerciseDate: 15-Sep-2022
             Name: "lookback_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',100,'simulationDates',datetime(2022,9,15))
outPricer = 
  BatesMonteCarlo with properties:
           DiscountCurve: [1×1 ratecurve]
               SpotPrice: 100
         SimulationDates: 15-Sep-2022
               NumTrials: 1000
           RandomNumbers: []
                   Model: [1×1 finmodel.Bates]
            DividendType: "continuous"
           DividendValue: 0
        MonteCarloMethod: "standard"
    BrownianMotionMethod: "standard"
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(outPricer,LookbackOpt,["all"])Price = 7.2577
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 
    ______    ________    _____    _______    _______    _________    ______    _______
    7.2577    -0.84025      0      -11.577    -29.025    -0.027666    30.748    0.68416
More About
A lookback option is a path-dependent option based on the maximum or minimum value the underlying asset achieves during the entire life of the option.
A lookback option's value is derived from an underlying asset, such as a stock, index, or currency pair. The option holder has the right to buy (call option) or sell (put option) the underlying asset at the most favorable price observed during the specified period.
Financial Instruments Toolbox™ software supports two types of lookback options: fixed and floating. Fixed lookback options have a specified strike price, while floating lookback options have a strike price determined by the asset path. For more information, see Lookback Option.
Version History
Introduced in R2020aAlthough Lookback 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.
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)