亚式期权相关函数
大约 6 分钟
亚式期权相关函数
构建函数
Excel: =McpAsianOption(args1, args2, args3, args4, args5, fmt='VP')
Python: =McpAsianOption(*args)
- 功能:构造亚式期权对象。
- 参数:
args1~args5或*args:参数组,支持以下两种传参方式:- 第一种参数传递方式:
CallPut:期权类型(枚举值,如Call或Put)。ReferenceDate:交易日或估值日。SpotPx:即期价格。AveRate:初始平均价。FirstAverageDate:平均价-开始日。ExpiryDate:到期日。SettlementDate:交割日。StrikePx:行权价。ForwardPx:远期价格。DomesticRate:货币2的利率。ForeignRate:货币1的利率。BuySell:买卖方向(枚举值,如Buy或Sell)。Volatility:波动率。PremiumDate:期权费支付日期。FixingFrequency:固定频率,默认值Monthly。LastAverageDate:平均价-结束日。CalculatedTarget:计算目标,默认值CCY1。AverageMethod:平均价计算方法,默认值Arithmetic。StrikeType:行权价类型,默认值Fixed。PricingMethod:定价方法,默认值BINOMIAL。FaceAmount:本金,默认值1。NumSimulation:模拟次数(MC),默认值10000。FixingDateAdjuster:固定日期调整规则,默认值ModifiedFollowing。KeepEndOfMonth:日期-月末规则,默认值True。FixingLongStub:平均价-长残端,默认值False。FixingEndStub:平均价-短残端,默认值True。Calendar:节假日对象。DayCounter:计息规则,默认值Act365Fixed。TimeStep:时间步长,默认值10。PipsUnit:点值单位,默认值10000。
- 第二种参数传递方式:
CallPut:期权类型(枚举值)。ReferenceDate:交易日或估值日。SpotPx:即期价格。AveRate:初始平均价。FirstAverageDate:平均价-开始日。ExpiryDate:到期日。SettlementDate:交割日。StrikePx:行权价。DomesticRate:货币2的利率。ForeignRate:货币1的利率。BuySell:买卖方向(枚举值)。Volatility:波动率。PremiumDate:期权费支付日期。NumFixings:固定次数。Calendar:节假日对象。DayCounter:计息规则,默认值Act365Fixed。AverageMethod:平均价计算方法,默认值Arithmetic。StrikeType:行权价类型,默认值Fixed。PricingMethod:定价方法,默认值BINOMIAL。FaceAmount:本金,默认值1。TimeStep:时间步长,默认值10。NumSimulation:模拟次数(MC),默认值10000。PipsUnit:点值单位,默认值10000。
- 第一种参数传递方式:
fmt:参数格式,默认值'VP',Excel专用参数。
- 返回:亚式期权对象。
使用函数
Excel: =McpPrice(Obj, isAmount)
Python: =Price(*args)
- 功能:计算期权费。
- 参数:
Obj:亚式期权对象。isAmount:是否返回金额(默认True,返回货币二期权费;False返回货币一期权费)。*args:是一个字典,不需要Obj参数,其他参数同Excel的参数。
- 返回:期权费。
Excel: =McpDelta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Delta(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Delta值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Delta。
Excel: =McpForwardDelta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =ForwardDelta(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的ForwardDelta值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:ForwardDelta。
Excel: =McpVega(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Vega(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Vega值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Vega。
Excel: =McpGamma(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Gamma(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Gamma值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Gamma。
Excel: = McpTheta(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Theta(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Theta值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Theta。
Excel: = McpVanna(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Vanna(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Vanna值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Vanna。
Excel: =McpVolga(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Volga(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Volga值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Volga。
Excel: = McpRho(obj, isCcy2=False, isAmount=True, pricingMethod=1, isClosedFormMethod=True)
Python: =Rho(isCCY2=False, isAmount=True, npricingMethod=1)
- 功能:计算期权的Rho值。
- 参数:
obj:亚式期权对象,Python Api不需要这个参数。isCcy2:是否是货币二。True表示是货币二,False表示不是。isAmount:是否计算量,默认值为True。pricingMethod:定价方法,默认值为1。isClosedFormMethod:是否使用闭式方法计算Greeks值,默认值为True。如果为True,则无论选择哪种模型计算Premium,Greeks值都采用Black-Scholes模型计算;否则使用选定的模型计算Greeks值。
- 返回:Rho。
Excel: = AOFixingSchedule(obj, fmt='V')
- 功能:获取平均价定价日期。
- 参数:
obj:McpAsianOption对象。fmt:参数格式,默认值为“V”。
- 返回:平均价定价日期。
