本地波动率类函数
大约 3 分钟
本地波动率类函数
构建函数
Excel: =McpLocalVol(args1, args2, args3, args4, args5, fmt='DT|VP|HD')
Python: McpLocalVol(*args)
- 功能:构造本地波动率对象。
- 参数:
args1~args5或*args
:参数组,支持以下三种传参方式:- 汇率类参数:
ReferenceDate
:交易日或估值日。Spot
:即期价格。ExpiryDates
:到期日数组。OptionTypes
:期权类型数组。Strikes
:行权价数组。Premiums
:期权费数组。PremiumAdjusted
:是否调整溢价(默认False
)。DomesticCurve
:Ccy2 的利率曲线对象。ForeignCurve
:Ccy1 的利率曲线对象。FXForwardCurve
:远期曲线对象。CalculatedTarget
:计算目标(枚举值)。LocalVolModel
:模型(枚举值)。LogLevel
:日志级别(枚举值)。TraceFile
:日志文件路径(非必填)。Calendar
:节假日对象。DateAdjusterRule
:调整规则(枚举值)。SpotDate
:起息日。ImpVols
:隐含波动率数组。MiniStrikeSize
:最小行权价数量(默认不计算小于此值的行权价)。UsingImpVols
:是否使用隐含波动率(默认True
)。
- 指数类参数:
ReferenceDate
:交易日或估值日。Spot
:即期价格。ExpiryDates
:到期日数组。OptionTypes
:期权类型数组。Strikes
:行权价数组。Premiums
:期权费数组。RiskFreeRateCurve
:无风险利率曲线对象。Dividend
:股息。LocalVolModel
:模型(枚举值)。LogLevel
:日志级别(枚举值)。TraceFile
:日志文件路径(非必填)。Calendar
:节假日对象。DateAdjusterRule
:调整规则(枚举值)。SpotDate
:起息日。ImpVols
:隐含波动率数组。MiniStrikeSize
:最小行权价数量(默认不计算小于此值的行权价)。UsingImpVols
:是否使用隐含波动率(默认True
)。
- 商品类参数:
ReferenceDate
:交易日或估值日。ExpiryDates
:到期日数组。OptionTypes
:期权类型数组。Strikes
:行权价数组。Premiums
:期权费数组。RiskFreeRateCurve
:无风险利率曲线对象。ForwardCurve
:远期曲线对象。LocalVolModel
:模型(枚举值)。LogLevel
:日志级别(枚举值)。TraceFile
:日志文件路径(非必填)。Calendar
:节假日对象。DateAdjusterRule
:调整规则(枚举值)。SpotDate
:起息日。ImpVols
:隐含波动率数组。MiniStrikeSize
:最小行权价数量(默认不计算小于此值的行权价)。UsingImpVols
:是否使用隐含波动率(默认True
)。
- 汇率类参数:
fmt
:参数格式(默认DT|VP|HD
),Excel专用参数。
- 返回:本地波动率对象。
使用函数
Excel: =HmReport(obj)
- 功能:生成本地波动率的校准报告。
- 参数:
obj
:本地波动率对象。
- 返回:校准报告。
Excel:=LocalVolGetForward(vs, expiryOrDeliveryDate, isDeliveryDate)
Python: GetForward(expiryOrDeliveryDate, isDeliveryDate)
- 功能:通过本地波动率获取远期价格。
- 参数:
vs
:本地波动率对象,Python Api不需要这个参数。expiryOrDeliveryDate
:到期日或交割日。isDeliveryDate
:是否为交割日(True
或False
)。
- 返回:远期价格。
Excel:=LocalVolGetUnderlyingRate(vs, expiryOrDeliveryDate, isDeliveryDate)
Python: GetUnderlyingRate(expiryOrDeliveryDate, isDeliveryDate)
- 功能:通过本地波动率获取 UnderlyingRate。
- 参数:
vs
:本地波动率对象,Python Api不需要这个参数。expiryOrDeliveryDate
:到期日或交割日。isDeliveryDate
:是否为交割日(True
或False
)。
- 返回:UnderlyingRate。
Excel:=LocalVolGetRiskFreeRate(vs, expiryOrDeliveryDate, isDeliveryDate)
Python: GetRiskFreeRate(expiryOrDeliveryDate, isDeliveryDate)
- 功能:通过本地波动率获取 RiskFreeRate。
- 参数:
vs
:本地波动率对象,Python Api不需要这个参数。expiryOrDeliveryDate
:到期日或交割日。isDeliveryDate
:是否为交割日(True
或False
)。
- 返回:RiskFreeRate。
注意事项
- 参数格式:
fmt
参数用于指定参数格式,默认值为DT|VP|HD
。 - 枚举值:部分参数(如
LocalVolModel
、LogLevel
)为枚举值,需参考具体定义。 - 默认值:未明确说明的参数通常有默认值,可根据需求调整。