障碍期权相关函数
大约 5 分钟
障碍期权相关函数
构建函数
Excel: =McpVanillaBarriers(args1, args2, args3, args4, args5, fmt='VP')
Python: McpVanillaBarriers(*args)
- 功能:构造障碍期权对象。
- 参数:
args1~args5或*args
:参数组:OptionType
:期权类型(枚举值,如Call
或Put
)。BarrierType
:障碍类型(枚举值,如UpAndOut
或DownAndIn
)。ReferenceDate
:交易日或估值日。SpotPx
:即期价格。BuySell
:买卖方向(枚举值,如Buy
或Sell
)。ExpiryDate
:到期日。DeliveryDate
:交割日。StrikePx
:行权价。Barrier
:障碍价格。DomesticRate
:货币2的利率。ForeignRate
:货币1的利率。Volatility
:波动率。FaceValue
:本金,默认值1
。Rebate
:回扣值,默认值0.0
。PricingMethod
:定价方法,默认值BLACKSCHOLES
。OptionExpiryNature
:行权类型,默认值EUROPEAN
。RR25
:25RR市场数据。BF25
:25BF市场数据。DiscreteFactor
:离散因子。DiscreteAdjusted
:离散调整值。Calendar
:节假日对象。DayCounter
:计息规则,默认值Act365Fixed
。PremiumDate
:期权费支付日期。
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(self, 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。