price
Compute price for equity instrument withFiniteDifference
价格
Description
[
根据定价对象计算仪器价格和相关定价信息价格
,价格Result
] =价格(inpPricer
,inpInstrument
)inpPricer
and the instrument objectinpInstrument
.
[
adds an optional argument to specify sensitivities.价格
,价格Result
] =价格(___,inpSensitivity
)
Examples
利用Finite Difference Pricer and Black-Scholes Model to Price Barrier Instrument
此示例显示了工作流程的价格Barrier
当您使用的乐器黑色
模型和FiniteDifference
pricing method.
创造Barrier
乐器Object
利用FinInstrument
to create aBarrier
仪器对象。
BarrierOpt = fininstrument("Barrier",'Strike',105,“锻炼”,DateTime(2019,1,1),'optionType',"call",“锻炼”,“美国人”,'Barriertype',“做”,'BarrierValue',40,'Name',"barrier_option")
BarrierOpt = Barrier with properties: OptionType: "call" Strike: 105 BarrierType: "do" BarrierValue: 40 Rebate: 0 ExerciseStyle: "american" ExerciseDate: 01-Jan-2019 Name: "barrier_option"
创造黑色
Model Object
利用Finmodel
to create a黑色
model object.
blackscholesmodel = finmodel(“黑色”,'Volatility',0.30)
黑色Model = BlackScholes with properties: Volatility: 0.3000 Correlation: 1
创造ratecurve
Object
创建一个公寓ratecurve
object usingratecurve
.
Settle = datetime(2018,1,1); Maturity = datetime(2023,1,1); Rate = 0.035; myRC = ratecurve('零',Settle,Maturity,Rate,'基础',1)
myRC = ratecurve with properties: Type: "zero" Compounding: -1 Basis: 1 Dates: 01-Jan-2023 Rates: 0.0350 Settle: 01-Jan-2018 InterpMethod: "linear" ShortExtrapMethod: "next" LongExtrapMethod: "previous"
创造FiniteDifference
价格r Object
利用finpricer
to create aFiniteDifference
价格object and use theratecurve
object for the'DiscountCurve'
name-value pair argument.
outPricer = finpricer("FiniteDifference",'模型',blackscholesmodel,'DiscountCurve',myRC,'现货价格',100)
outPricer = FiniteDifference with properties: DiscountCurve: [1x1 ratecurve] Model: [1x1 finmodel.BlackScholes] SpotPrice: 100 GridProperties: [1x1 struct] DividendType: "continuous" DividendValue: 0
价格Barrier
乐器
利用price
to compute the price and sensitivities for theBarrier
乐器。
[Price,extpr] = Price(Outpricer,Barrieropt,[“全部”)))
价格= 11.3230
outPR = priceresult with properties: Results: [1x7 table] PricerData: [1x1 struct]
outPR.Results
ans=1×7 table价格Delta Gamma Lambda Theta Rho Vega ______ _______ ______ ______ _______ ______ ______ 11.323 0.54126 0.0132 4.7802 -7.4408 42.766 39.627
Input Arguments
inpPricer
—定价对象
FiniteDifference
object
定价对象, specified as a scalarFiniteDifference
定价对象。利用finpricer
创建FiniteDifference
定价对象。
Data Types:object
inpInstrument
—乐器object
Vanilla
object|Barrier
object|DoubleBarrier
object|可换股债券
object
乐器object, specified as a scalar or vector ofVanilla
,Barrier
,DoubleBarrier
, or可换股债券
仪器对象。利用FinInstrument
创建Vanilla
,Barrier
,DoubleBarrier
, or可换股债券
仪器对象。
Data Types:object
inpSensitivity
—计算敏感性清单
[]
(default) |带有值的字符串数组"Price"
,"Delta"
,“伽玛”
,"Vega"
,“ Rho”
,“ theta”
,"Lambda"
,“ Vegalt”
, 和"All"
|具有值的字符向量的单元格数'Price'
,'Delta'
,'伽玛'
,'Lambda'
,'Vegalt'
,'Vega'
,'rho'
,'Theta'
, 和'All'
(Optional) List of sensitivities to compute, specified as aNOUT
-经过-1
或者a1
-经过-NOUT
cell array of character vectors or string array with supported values.
inpSensitivity = {'All'}
或者inpSensitivity = ["All"]
指定输出为'Delta'
,'伽玛'
,'Vega'
,'Vegalt'
,'Lambda'
,'rho'
,'Theta'
, 和'Price'
. This is the same as specifyinginpSensitivity
to include each sensitivity.
例子:inpsentivity = {'delta','gamma','vega','vegalt','rho','lambda','theta','price'}
The sensitivities supported depend on theinpInstrument
.
inpInstrument | Supported Sensitivities |
---|---|
Vanilla , |
'delta','gamma','vega','vegalt','rho','lambda','theta','price' |
Barrier |
'delta','gamma','vega','rho','lambda','theta','price' |
DoubleBarrier |
'delta','gamma','vega','vegalt','rho','lambda','theta','price' |
可换股债券 |
'delta','gamma','vega','rho','lambda','theta','price' |
Data Types:string
|cell
Output Arguments
价格
- 仪器价格
数字
仪器价格,作为数字返回。
价格Result
— Price result
价格Result
object
价格result, returned as a价格Result
object. The object has the following fields:
价格Result.Results
——(如果表的结果,包括敏感性you specifyinpSensitivity
)Priceresult.pricerdata
— Structure for pricer data
Version History
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
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.
选择一个网站
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:.
您还可以从以下列表中选择一个网站:
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éricaLatina(Español)
- Canada(English)
- United States(English)
欧洲
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- 意大利(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- 瑞士
- 英国(English)