数字期权相关函数
大约 5 分钟
数字期权相关函数
构建函数
Excel: =McpEuropeanDigital(args1, args2, args3, args4, args5, fmt='VP')
Python: McpEuropeanDigital(*args)
- 功能:构造数字期权对象。
- 参数:
args1~args5或*args
:参数组:ReferenceDate
:交易日或估值日。DigitalType
:数字类型(枚举值,如CashOrNothing
或AssetOrNothing
)。BuySell
:买卖方向(枚举值,如Buy
或Sell
)。SpotPx
:即期价格。StrikePx
:行权价。Volatility
:波动率。ExpiryDate
:到期日。DeliveryDate
:交割日。DomesticRate
:货币2的利率。ForeignRate
:货币1的利率。PremiumDate
:期权费支付日期。FaceValue
:本金,默认值1
。Payoff
:盈亏。Calendar
:节假日对象。DayCounter
:计息规则,默认值Act365Fixed
。PricingMethod
:定价方法,默认值BLACKSCHOLES
。ReplicateDelta
:通过复制法对数字期权定价时,所构建的两个欧式期权的行权价的插值。RR25
:25RR市场数据。BF25
:25BF市场数据。
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(self, 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(self, 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。