BlackScholes
CreateBlackScholes
模型对象Asian
,,,,屏障
,,,,DoubleBarrier
,,,,回望
,,,,PartialLookback
,,,,Spread
,,,,香草
,,,,Touch
,,,,DoubleTouch
,,,,集团
, 或者二进制
乐器
Description
Create and price a香草
,,,,回望
,,,,PartialLookback
,,,,屏障
,,,,DoubleBarrier
Asian
,,,,Spread
,,,,Touch
,,,,DoubleTouch
,,,,集团
, 或者二进制
乐器object with aBlackScholes
使用此工作流的模型:
Use
fininstrument
创建一个香草
,,,,回望
,,,,PartialLookback
,,,,屏障
,,,,Asian
,,,,Spread
,,,,DoubleBarrier
,,,,集团
,,,,二进制
,,,,Touch
, 或者DoubleTouch
乐器object.Use
Finmodel
to specify theBlackScholes
模型对象香草
,,,,回望
,,,,PartialLookback
,,,,屏障
,,,,DoubleBarrier
,,,,Asian
,,,,Spread
,,,,Touch
,,,,DoubleTouch
,,,,集团
, 或者二进制
乐器object.Use
finpricer
to specify a supported pricing method. For more information on the available pricing methods for the香草
,,,,回望
,,,,PartialLookback
,,,,屏障
,,,,DoubleBarrier
,,,,Asian
,,,,Spread
,,,,Touch
,,,,DoubleTouch
,,,,集团
, 或者二进制
使用仪器对象BlackScholes
模型,请参阅选择仪器,模型和定价商。
有关此工作流程的更多信息,请参阅使用基于对象的框架来定价金融工具开始工作流程。
For more information on the available pricing methods for a香草
,,,,回望
,,,,PartialLookback
,,,,屏障
,,,,DoubleBarrier
,,,,Asian
,,,,Spread
,,,,Touch
,,,,DoubleTouch
, 或者二进制
使用仪器BlackScholes
模型,请参阅选择仪器,模型和定价商。
创建
句法
Description
设置可选特性using additional name-value pairs in addition to the required arguments in the previous syntax. For example,Blackscholesmodelobj
= finmodel(___,,,,姓名,,,,Value
)blackscholesmodelobj = finmodel("BlackScholes",'Volatility',0.032,'Correlation',Corr)
创建一个BlackScholes
模型对象。您可以指定多个名称值对参数。
Input Arguments
模型类型
-Model type
细绳with value"BlackScholes"
|角色向量有价值'黑色
Model type, specified as a string with the value of"BlackScholes"
或具有价值的角色向量'黑色
。
Data Types:char
|细绳
BlackScholes
姓名-Value Pair Arguments
指定所需的和可选的逗号分隔对姓名,,,,Value
arguments.姓名
是参数名称和Value
is the corresponding value.姓名
must appear inside quotes. You can specify several name and value pair arguments in any order as姓名1,,,,Value1,...,NameN,ValueN
。
blackscholesmodelobj = finmodel("BlackScholes",'Volatility',0.032,'Correlation',Corr)
BlackScholes
姓名-Value Pair Arguments
挥发性
-波动率值
nonnegative numeric
波动率值,指定为逗号分隔对'挥发性'
和标量非负数字。
Data Types:double
BlackScholes
姓名-Value Pair Arguments
相关性
-相关性between underlying asset prices
1
(默认)|半芬特矩阵
基础资产价格之间的相关性,指定为逗号分隔对'相关性'
and a semidefinite matrix. For more information on creating a positive semidefinite matrix, see近乎近的
。
Data Types:double
特性
挥发性
-波动率值
nonnegative numeric
波动率值,,,,returned as a scalar nonnegative numeric.
Data Types:double
Corrrelation
-基础资产之间的相关性
1
(默认)|semi-definite matrix
基础资产之间的相关性,作为半明确矩阵返回。
Data Types:double
Examples
使用黑色 - choles模型和Turnbull-Wakeman的价格来定价亚洲乐器
This example shows the workflow to price anAsian
乐器when you use aBlackScholes
model and a特恩布尔瓦克曼
pricing method.
CreateAsian
乐器Object
Usefininstrument
创建一个nAsian
乐器object.
AsianOpt = fininstrument(“亚洲”,,,,'ExerciseDate',,,,datetime(2022,9,15),'罢工',,,,105,'OptionType',,,,“放”,,,,'ExerciseStyle',,,,“欧洲的”,,,,'姓名',,,,“ Asian_option”)
AsianOpt = Asian with properties: OptionType: "put" Strike: 105 AverageType: "arithmetic" AveragePrice: 0 AverageStartDate: NaT ExerciseStyle: "european" ExerciseDate: 15-Sep-2022 Name: "asian_option"
CreateBlackScholes
Model Object
UseFinmodel
创建一个BlackScholes
模型对象。
BlackScholesModel = finmodel("BlackScholes",,,,'挥发性',,,,0.28)
blackscholesmodel =具有属性的黑色choles:波动率:0.2800相关性:1
Createratecurve
Object
Create a flatratecurve
对象使用ratecurve
。
Settle = DateTime(2018,9,15);成熟度= DateTime(2023,9,15);费率= 0.035;myrc = ratecurve('zero',,,,Settle,Maturity,Rate,'Basis',12)
MYRC =具有属性的比例:类型:“零”复合:-1基础:12个日期:15-Sep-2023速率:0.0350 settle:15-Sep-2018 InterpMethod:“ Linear” ShortextrapMethod:“ shortextrapmethod:” Next“ longextrapmethod:“先前”
Create特恩布尔瓦克曼
定价对象
Usefinpricer
创建一个TurnbulllWakeman
定价对象并使用ratecurve
对象“折扣”
名称值对参数。
eutpricer = finpricer("analytic",,,,'Model',,,,BlackScholesModel,“折扣”,,,,myRC,'SpotPrice',100,'PricingMethod',,,,"TurnbullWakeman")
Expricer = Turnbullwakeman具有属性:discountCurve:[1x1 ratecurve]模型:[1x1 FinModel.blackScholes] Spotprice:100 ratendendvalue:0 ratendendvalue:0 ratendendType:“连续”
PriceAsian
乐器
Useprice
计算价格和敏感性Asian
乐器。
[Price, outPR] = price(outPricer,AsianOpt,["all"])
价格= 11.2249
outPR = priceresult with properties: Results: [1x7 table] PricerData: []
outPR.Results
ans=1×7桌Price Delta Gamma Lambda Vega Theta Rho ______ ________ _______ _______ ______ _______ _______ 11.225 -0.38072 0.01087 -3.3917 44.242 -0.5256 -116.88
Use Black-Scholes Model and Asset Monte-Carlo Pricer to Price DoubleBarrier Instrument
This example shows the workflow to price aDoubleBarrier
乐器when you use aBlackScholes
模型和AssetMonteCarlo
pricing method.
CreateDoubleBarrier
乐器Object
Usefininstrument
创建一个DoubleBarrier
乐器object.
doubleBarrierOpt = Fininstrument(“双重行驶”,,,,'罢工',100,'ExerciseDate',DateTime(2020,8,15),'OptionType',,,,"call",,,,'ExerciseStyle',,,,"american",,,,'BarrierType',,,,“ dko”,,,,'barriervalue',,,,[110 80],'姓名',,,,"doublebarrier_option")
doubleBarrierOpt =带有属性的双重堡垒:optionType:“呼叫”罢工:100 BarrierValue:[110 80]锻炼:“ American”练习:15-AUG-2020 BARRIERTYPE:“ DKO” REBATE:[0 0] rebate:[0]名称:“ doublebarrier_option''
CreateBlackScholes
Model Object
UseFinmodel
创建一个BlackScholes
模型对象。
BlackScholesModel = finmodel("BlackScholes",,,,“挥发性”,,,,。3)
blackscholesmodel =具有属性的黑色choles:波动率:0.3000相关:1
Createratecurve
Object
Create a flatratecurve
对象使用ratecurve
。
Settle = datetime(2017,9,15); Maturity = datetime(2023,9,15); Rate = 0.035; myRC = ratecurve('zero',,,,Settle,Maturity,Rate,'Basis',12)
MYRC =具有属性的比例:类型:“零”复合:-1基础:12个日期:15-Sep-2023速率:0.0350 settle:15-Sep-2017 InterpMethod:“ Linear” ShortexTrapMethod:“ Next” longextrapmethod:“ longextrapmethod:“先前”
CreateAssetMonetCarlo
定价对象
Usefinpricer
创建一个nAssetMonetCarlo
定价对象并使用ratecurve
对象“折扣”
名称值对参数。
ExerciseDate = datetime(2020,08,15); Settle = datetime(2017,9,15); outPricer = finpricer("AssetMonteCarlo",,,,“折扣”,,,,myRC,“模型”,,,,BlackScholesModel,'SpotPrice',100,'simulationDates',定居+天(1):(1)天:行使);
PriceDoubleBarrier
乐器
Useprice
计算价格和敏感性DoubleBarrier
乐器。
[Price,extpr] = Price(Expricer,DoubleBarrierOpt,["all"])
价格= 6.9563
extpr =具有属性的定价:结果:[1x7表] PricerData:[1x1 struct]
outPR.Results
ans=1×7桌价格delta gamma lambda rho theta vega ______________________________________________________________________________________________________________________________________________-0-0-0-11.1.17例
使用黑色choles型号和资产树定价商来价格香草仪器
This example shows the workflow to price a香草
乐器when you use aBlackScholes
模型和AssetTree
pricing method.
Create香草
乐器Object
Usefininstrument
创建一个香草
乐器object.
Vanillaopt = Fininstrument("Vanilla",,,,'ExerciseDate',,,,datetime(2019,5,1),'罢工',,,,29,'OptionType',,,,“放”,,,,'ExerciseStyle',,,,“欧洲的”,,,,'姓名',,,,“ vanilla_option”)
Vanillaopt =带有属性的香草:optionType:“ put”锻炼:“欧洲”锻炼:01-May-2019罢工:29名称:“ vanilla_option”
CreateBlackScholes
Model Object
UseFinmodel
创建一个BlackScholes
模型对象。
BlackScholesModel = finmodel("BlackScholes",,,,'挥发性',,,,0.25)
BlackScholesModel = BlackScholes with properties: Volatility: 0.2500 Correlation: 1
Createratecurve
Object
Create a flatratecurve
对象使用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"
CreateAssetTree
定价对象
Usefinpricer
创建一个nAssetTree
pricer object for a LR equity tree and use theratecurve
对象“折扣”
名称值对参数。
LRPricer = finpricer("AssetTree",,,,“折扣”,,,,myRC,'Model',,,,BlackScholesModel,'SpotPrice',,,,30,'PricingMethod',,,,“ LeisenReimer”,,,,'到期',,,,datetime(2019,5,1),'numperiods',15)
LRPricer = LRTree with properties: InversionMethod: PP1 Strike: 30 Tree: [1x1 struct] NumPeriods: 15 Model: [1x1 finmodel.BlackScholes] DiscountCurve: [1x1 ratecurve] SpotPrice: 30 DividendType: "continuous" DividendValue: 0 TreeDates: [02-Feb-2018 08:00:00 06-Mar-2018 16:00:00 ... ]
Price香草
乐器
Useprice
计算价格和敏感性香草
乐器。
[Price,extpr] = Price(lrpricer,Vanillaopt,"all")
价格= 2.2542
extpr =具有属性的定价:结果:[1x7表] PricerData:[1x1 struct]
outPR.Results
ans=1×7桌Price Delta Gamma Vega Lambda Rho Theta ______ ________ ________ ______ ______ _______ ________ 2.2542 -0.33628 0.044039 12.724 -4.469 -16.433 -0.76073
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
您单击了与此MATLAB命令相对应的链接:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
Americas
- América Latina(Español)
- Canada(English)
- United States(English)