OPPZ_IV
简述
品种期权隐含波动率,与系统证券、时间、周期相关
OPPZ_IV(OPType:Integer;MaturityDate:Integer;ValueState:Real;ValueStateMethod:Real; IVMethod:Integer):Real;
| 名称 | 类型 | 说明 |
|---|
| OPType | Integer | 期权类型,整型,取值如下
|
取值 |
含义 | |
0 |
全部期权(默认) | |
1 |
认购期权 | |
2 |
认沽期权 |
|
| MaturityDate | Integer | 到期日,整型
|
取值 |
含义 | |
0 |
全部到期日的期权(默认) | |
1 |
近月到期期权 | |
2 |
次近月到期期权 | |
…… |
依次类推 |
|
| ValueState | Real | 价值状态,实数 or 数组,期权价值状态=行权价/标的资产价格(K/S),比如价值状态=1表示平值期权,0或缺省表示所有价值状态的期权 |
| ValueStateMethod | Real | 价值状态选取方法,整型,当ValueState取非0实数时使用,用于选取指定价值状态ValueState下的期权,取值如下
|
取值 |
含义 |
备注 | |
0 |
整体最邻近 |
整体价值状态最接近FOPValueState的期权(默认) | |
1 |
前后邻近 |
选取价值状态小于及大于FOPValueState的前后邻近期权,包含整体最邻近期权 |
|
| IVMethod | Integer | IV计算方法,整型,取值如下
|
取值 |
含义 | |
0 |
等权(默认) | |
1 |
成交量加权 | |
2 |
Vega加权 | |
3 |
特定平值合约(行权价 最接近 标的价格 的合约) |
|
| 返回 | Real | 实数,品种期权隐含波动率 |
setsysparam(pn_stock(),"SZ159919");
setsysparam(PN_Date(),20210331T);
setsysparam(PN_Cycle(),cy_day());
OPType:=0;
MaturityDate:=1;
ValueState:=1;
ValueStateMethod:=0;
IVMethod:=0;
return OPPZ_IV(OPType,MaturityDate,ValueState,ValueStateMethod,IVMethod);
//返回:19.06
Options_IV