price
Syntax
Description
[
computes the equity instrument price and related pricing information based on the pricing
object Price,PriceResult] = price(inpPricer,inpInstrument)inpPricer and the instrument object
inpInstrument.
[
adds an optional argument to specify sensitivities in addition to the required arguments
in the previous syntax.Price,PriceResult] = price(___,inpSensitivity)
Examples
This example shows the workflow to price a Vanilla instrument when you use a BlackScholes model and an AssetTree pricing method.
Create Vanilla Instrument Object
Use fininstrument to create a Vanilla instrument object.
VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2019,5,1),'Strike',29,'OptionType',"put",'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt =
Vanilla with properties:
OptionType: "put"
ExerciseStyle: "european"
ExerciseDate: 01-May-2019
Strike: 29
Name: "vanilla_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object.
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.25)
BlackScholesModel =
BlackScholes with properties:
Volatility: 0.2500
Correlation: 1
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,1,1); Maturity = datetime(2020,1,1); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',1)
myRC =
ratecurve with properties:
Type: "zero"
Compounding: -1
Basis: 1
Dates: 01-Jan-2020
Rates: 0.0350
Settle: 01-Jan-2018
InterpMethod: "linear"
ShortExtrapMethod: "next"
LongExtrapMethod: "previous"
Create AssetTree Pricer Object
Use finpricer to create an AssetTree pricer object for an LR equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
LRPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',30,'PricingMethod',"LeisenReimer",'Maturity',datetime(2019,5,1),'NumPeriods',15)
LRPricer =
LRTree with properties:
InversionMethod: PP1
Strike: 30
Tree: [1×1 struct]
NumPeriods: 15
Model: [1×1 finmodel.BlackScholes]
DiscountCurve: [1×1 ratecurve]
SpotPrice: 30
DividendType: "continuous"
DividendValue: 0
TreeDates: [02-Feb-2018 08:00:00 06-Mar-2018 16:00:00 08-Apr-2018 00:00:00 10-May-2018 08:00:00 11-Jun-2018 16:00:00 14-Jul-2018 00:00:00 15-Aug-2018 08:00:00 16-Sep-2018 16:00:00 … ] (1×15 datetime)
Price Vanilla Instrument
Use price to compute the price and sensitivities for the Vanilla instrument.
[Price, outPR] = price(LRPricer,VanillaOpt,"all")Price = 2.2542
outPR =
priceresult with properties:
Results: [1×7 table]
PricerData: [1×1 struct]
outPR.Results
ans=1×7 table
Price Delta Gamma Vega Lambda Rho Theta
______ ________ ________ ______ ______ _______ ________
2.2542 -0.33628 0.044039 12.724 -4.469 -16.433 -0.76073
This example shows the workflow to price a Vanilla instrument when you use a BlackScholes model and an AssetTree pricing method for a Standard Trinomial (STT) tree.
Create Vanilla Instrument Object
Use fininstrument to create a Vanilla instrument object.
VanillaOpt = fininstrument("Vanilla",'ExerciseDate',datetime(2019,5,1),'Strike',29,'OptionType',"put",'ExerciseStyle',"european",'Name',"vanilla_option")
VanillaOpt =
Vanilla with properties:
OptionType: "put"
ExerciseStyle: "european"
ExerciseDate: 01-May-2019
Strike: 29
Name: "vanilla_option"
Create BlackScholes Model Object
Use finmodel to create a BlackScholes model object.
BlackScholesModel = finmodel("BlackScholes",'Volatility',0.25)
BlackScholesModel =
BlackScholes with properties:
Volatility: 0.2500
Correlation: 1
Create ratecurve Object
Create a flat ratecurve object using ratecurve.
Settle = datetime(2018,1,1); Maturity = datetime(2020,1,1); Rate = 0.035; myRC = ratecurve('zero',Settle,Maturity,Rate,'Basis',1)
myRC =
ratecurve with properties:
Type: "zero"
Compounding: -1
Basis: 1
Dates: 01-Jan-2020
Rates: 0.0350
Settle: 01-Jan-2018
InterpMethod: "linear"
ShortExtrapMethod: "next"
LongExtrapMethod: "previous"
Create AssetTree Pricer Object
Use finpricer to create an AssetTree pricer object for an Standard Trinomial equity tree and use the ratecurve object for the 'DiscountCurve' name-value pair argument.
STTPricer = finpricer("AssetTree",'DiscountCurve',myRC,'Model',BlackScholesModel,'SpotPrice',30,'PricingMethod',"StandardTrinomial",'Maturity',datetime(2019,5,1),'NumPeriods',15)
STTPricer =
STTree with properties:
Tree: [1×1 struct]
NumPeriods: 15
Model: [1×1 finmodel.BlackScholes]
DiscountCurve: [1×1 ratecurve]
SpotPrice: 30
DividendType: "continuous"
DividendValue: 0
TreeDates: [02-Feb-2018 08:00:00 06-Mar-2018 16:00:00 08-Apr-2018 00:00:00 10-May-2018 08:00:00 11-Jun-2018 16:00:00 14-Jul-2018 00:00:00 15-Aug-2018 08:00:00 16-Sep-2018 16:00:00 … ] (1×15 datetime)
Price Vanilla Instrument
Use price to compute the price and sensitivities for the Vanilla instrument.
[Price, outPR] = price(STTPricer,VanillaOpt,"all")Price = 2.2826
outPR =
priceresult with properties:
Results: [1×7 table]
PricerData: [1×1 struct]
outPR.Results
ans=1×7 table
Price Delta Gamma Vega Lambda Rho Theta
______ _______ ________ _____ _______ _______ ________
2.2826 -0.2592 0.030949 12.51 -3.8981 -16.516 -0.73845
Input Arguments
Instrument object, specified as a scalar or vector of previously created instrument
objects. Create the instrument objects using fininstrument. The following
instrument objects are supported:
Data Types: object
(Optional) List of sensitivities to compute, specified as an
NOUT-by-1 or a
1-by-NOUT cell array of character vectors or
string array with possible values of 'Price',
'Delta', 'Gamma', 'Vega',
'Theta', 'Rho', 'Lambda', and
'All'.
inpSensitivity = {'All'} or inpSensitivity =
["All"] specifies that the output is 'Delta',
'Gamma', 'Vega', 'Theta',
'Rho', 'Lambda', and 'Price'.
Using this syntax is the same as specifying inpSensitivity to include
each sensitivity.
| inpInstrument | Supported Sensitivities |
|---|---|
Asian | {'delta','gamma','vega','theta','rho','lambda','price'} |
Barrier | {'delta','gamma','vega','theta','rho','lambda','price'} |
Lookback | {'delta','gamma','vega','theta','rho','lambda','price'} |
Vanilla | {'delta','gamma','vega','theta','rho','lambda','price'} |
Note
Sensitivities are calculated based on yield shifts of 1 basis point, where the ShiftValue = 1/10000. All sensitivities are returned as dollar sensitivities. To find the per-dollar sensitivities, divide the sensitivities by their respective instrument price.
Example: inpSensitivity =
{'delta','gamma','vega','price'}
Data Types: string | cell
Output Arguments
Instrument price, returned as a numeric.
Price result, returned as a PriceResult object. The object has
the following fields:
PriceResult.Results— Table of results that includes sensitivities (if you specifyinpSensitivity)PriceResult.PricerData— Structure for pricer data that depends on the instrument that is being pricedAsianandLookbackhave an empty ([])PricerDatafield because the pricing functions for these instruments cannot unambiguously assign a price to any node but the root node.VanillaandBarrierhave the following shared fields forPriceResult.PricerData.PriceTree:PTreecontains the clean prices.ExTreecontains the exercise indicator arrays. Each element of the cell array is an array where1indicates that an option is exercised and0indicates that an option is not exercised.dObscontains the date of each level of the tree.tObscontains the observation times.Probscontains the probability arrays. Each element of the cell array contains the up, middle, and down transition probabilities for each node of the level.
More About
A delta sensitivity measures the rate at which the price of an option is expected to change relative to a $1 change in the price of the underlying asset.
Delta is not a static measure; it changes as the price of the underlying asset changes (a concept known as gamma sensitivity), and as time passes. Options that are near the money or have longer until expiration are more sensitive to changes in delta.
A gamma sensitivity measures the rate of change of an option's delta in response to a change in the price of the underlying asset.
In other words, while delta tells you how much the price of an option might move, gamma tells you how fast the option's delta itself will change as the price of the underlying asset moves. This is important because this helps you understand the convexity of an option's value in relation to the underlying asset's price.
A vega sensitivity measures the sensitivity of an option's price to changes in the volatility of the underlying asset.
Vega represents the amount by which the price of an option would be expected to change for a 1% change in the implied volatility of the underlying asset. Vega is expressed as the amount of money per underlying share that the option's value will gain or lose as volatility rises or falls.
A theta sensitivity measures the rate at which the price of an option decreases as time passes, all else being equal.
Theta is essentially a quantification of time decay, which is a key concept in options pricing. Theta provides an estimate of the dollar amount that an option's price would decrease each day, assuming no movement in the price of the underlying asset and no change in volatility.
A rho sensitivity measures the rate at which the price of an option is expected to change in response to a change in the risk-free interest rate.
Rho is expressed as the amount of money an option's price would gain or lose for a one percentage point (1%) change in the risk-free interest rate.
A lambda sensitivity measures the percentage change in an option's price for a 1% change in the price of the underlying asset.
Lambda is a measure of leverage, indicating how much more sensitive an option is to price movements in the underlying asset compared to owning the asset outright.
Version History
Introduced in R2021a
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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)