Lookback instrument
Create and price a Lookback instrument object using this
workflow:
Use fininstrument
to create a Lookback instrument object.
Use finmodel to specify
a BlackScholes, Heston, Bates, or Merton model for
the Lookback instrument.
When using a BlackScholes model, use finpricer
to specify a ConzeViswanathan, AssetTree, or GoldmanSosinGatto pricing method for the
Lookback instrument.
When using a BlackScholes,
Heston, Bates, or
Merton model, use finpricer
to specify an AssetMonteCarlo pricing method for the
Lookback instrument.
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.
creates a LookbackObj = fininstrument(InstrumentType,'Strike',strike_value,'ExerciseDate',exercise_date)Lookback object by specifying
InstrumentType and sets the properties for the
required name-value pair arguments Strike and
ExerciseDate.
The Lookback instrument supports fixed and floating
strike lookback options. For more information on a
Lookback instrument, see More About.
sets optional properties using
additional name-value pairs in addition to the required arguments in the
previous syntax. For example, 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.
InstrumentType — Instrument type"Lookback" | character vector with value 'Lookback'Instrument type, specified as a string with the value of
"Lookback" or a character vector with the value
of 'Lookback'.
Data Types: char | string
Lookback Name-Value Pair ArgumentsSpecify required
and optional comma-separated pairs of Name,Value arguments.
Name is the argument name and Value is
the corresponding value. Name must appear inside quotes. You
can specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
LookbackObj =
fininstrument("Lookback",'Strike',100,'ExerciseDate',datetime(2019,1,30),'OptionType',"put",'ExerciseStyle',"European",'Name',"lookback_option")Lookback Name-Value Pair Arguments'Strike' — Option strike price valueNaNOption strike price value, specified as the comma-separated pair
consisting of 'Strike' and a scalar nonnegative
numeric value for a fixed strike Lookback option
or a NaN for a floating strike
Lookback option.
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
'ExerciseDate' — Option exercise dateOption exercise date, specified as the comma-separated pair
consisting of 'ExerciseDate' and a scalar
datetime, serial date number, date character vector, or date string.
Note
For a European option, there is only one
ExerciseDate on the option expiry
date.
If you use a date character vector or date string, the format must
be recognizable by datetime because
the ExerciseDate property is stored as a
datetime.
Data Types: double | char | string | datetime
Lookback Name-Value Pair Arguments'OptionType' — Option type "call" (default) | string with value "call" or
"put" | character vector with value 'call' or
'put'Option type, specified as the comma-separated pair consisting of
'OptionType' and a scalar string or character
vector.
Data Types: char | string
'ExerciseStyle' — Option exercise style"European" (default) | string with value "European" or
"American" | character vector with value 'European' or
'American'Option exercise style, specified as the comma-separated pair
consisting of 'ExerciseStyle' and a scalar string
or character vector.
Data Types: string | char
'AssetMinMax' — Maximum or minimum underlying asset priceNaN where
SpotPrice of the underlying asset is
used (default) | scalar numeric Maximum or minimum underlying asset price, specified as the
comma-separated pair consisting of 'AssetMinMax'
and a scalar numeric.
Data Types: double
'Name' — User-defined name for instrument" "
(default) | string | character vectorUser-defined name for the instrument, specified as the
comma-separated pair consisting of 'Name' and a
scalar string or character vector.
Data Types: char | string
Strike — Option strike price valueOption strike price value, returned as a scalar nonnegative numeric.
Data Types: double
ExerciseDate — Option exercise dateOption exercise date, returned as a datetime.
Data Types: datetime
OptionType — Option type"call" (default) | string with value "call" or
"put"Option type, returned as a string with a value of
"call" or "put".
Data Types: string
ExerciseStyle — Option exercise style"European" (default) | string with value "European" or
"American"Option exercise style, returned as a string with a value of
"European" or "American".
Data Types: string
AssetMinMax — Maximum or minimum underlying asset priceNaN where SpotPrice
of the underlying asset is used (default) | scalar numeric Maximum or minimum underlying asset price, returned as a scalar numeric.
Data Types: double
Name — User-defined name for instrument" "
(default) | stringUser-defined name for the instrument, returned as a string.
Data Types: string
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: [1x1 ratecurve]
Model: [1x1 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: [1x7 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 a LookBack instrument when you use an BlackScholes model and an AssetTree 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 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: [1x1 struct]
NumPeriods: 15
Model: [1x1 finmodel.BlackScholes]
DiscountCurve: [1x1 ratecurve]
SpotPrice: 150
DividendType: "continuous"
DividendValue: 0
TreeDates: [1x15 datetime]
LRPricer.Tree
ans = struct with fields:
Probs: [2x15 double]
ATree: {1x16 cell}
dObs: [1x16 datetime]
tObs: [1x16 double]
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: [1x7 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 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: [1x1 ratecurve]
SpotPrice: 200
SimulationDates: 15-Sep-2022
NumTrials: 1000
RandomNumbers: []
Model: [1x1 finmodel.BlackScholes]
DividendType: "continuous"
DividendValue: 0
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: [1x7 table]
PricerData: [1x1 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 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: [1x1 ratecurve]
SpotPrice: 100
SimulationDates: 15-Sep-2022
NumTrials: 1000
RandomNumbers: []
Model: [1x1 finmodel.Bates]
DividendType: "continuous"
DividendValue: 0
Price Lookback Instrument
Use price to compute the price and sensitivities for the Lookback instrument.
[Price, outPR] = price(outPricer,LookbackOpt,["all"])Price = 7.3592
outPR =
priceresult with properties:
Results: [1x8 table]
PricerData: [1x1 struct]
outPR.Results
ans=1×8 table
Price Delta Gamma Lambda Rho Theta Vega VegaLT
______ ________ ___________ _______ _______ _________ ______ _______
7.3592 -0.83923 -3.5527e-15 -11.404 -29.431 -0.030786 31.941 0.71394
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.
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.
You have a modified version of this example. Do you want to open this example with your edits?