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. Use this syntax with the input
argument combination in the previous syntax.Price
,PriceResult
] = price(___,inpSensitivity
)
Examples
Price Touch
Instrument Using Heston
Model and AssetMonteCarlo
Pricer
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
Input Arguments
inpPricer
— Pricer object
AssetMonteCarlo
object
Pricer object, specified as a previously created AssetMonteCarlo
pricer
object. Create the pricer object using finpricer
.
Data Types: object
inpInstrument
— Instrument object
Vanilla
object | Barrier
object | Lookback
object | Asian
object | DoubleBarrier
object | Spread
object | Touch
object | DoubleTouch
object | Cliquet
object | Binary
object
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
inpSensitivity
— List of sensitivities to compute
[ ]
(default) | string array with values dependent on pricer object | cell array of character vectors with values dependent on pricer object
(Optional) List of sensitivities to compute, specified as an
NOUT
-by-1
or
1
-by-NOUT
cell array of character vectors or
string array.
The supported sensitivities depend on the pricing method.
inpInstrument Object | Supported Sensitivities |
---|---|
Vanilla | {'delta','gamma','vega',
'theta','rho','price','lambda'} |
Lookback | {'delta','gamma','vega','theta','rho','price','lambda'} |
Barrier | {'delta','gamma','vega','theta','rho','price','lambda'} |
Asian | {'delta','gamma','vega','theta','rho','price','lambda'} |
Spread | {'delta','gamma','vega','theta','rho','price','lambda}' |
DoubleBarrier | {'delta','gamma','vega','theta','rho','price','lambda}' |
Cliquet | {'delta','gamma','vega','theta','rho','price','lambda}' |
Binary | {'delta','gamma','vega','theta','rho','price','lambda'} |
Touch | {'delta','gamma','vega','theta','rho','price','lambda'} |
DoubleTouch | {'delta','gamma','vega','theta','rho','price','lambda'} |
inpSensitivity = {'All'}
or inpSensitivity =
["All"]
specifies that all sensitivities for the pricing method are
returned. This is the same as specifying inpSensitivity
to include
each sensitivity.
Example: inpSensitivity =
["delta","gamma","vega","lambda","rho","theta","price"]
Data Types: cell
| string
Output Arguments
Price
— Instrument price
numeric
Instrument price, returned as a numeric.
PriceResult
— Price result
PriceResult
object
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
Note
The inpPricer
options that do not support sensitivities do
not return a PriceResult
. For example, there is no
PriceResult
returned for when you use a
Black
, CDSBlack
,
HullWhite
, Normal
, or
SABR
pricing method.
Version History
Introduced in R2020b
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは 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)