DepositOfOptionByGroup
简述
期权组合保证金计算,与系统参数时间有关
DepositOfOptionByGroup(Option:Integer;OptionID:String;position:Integer;OptionID2:String;position2:Integer;Price:Real;price2:Real;StockPrice:Real;P1:Real;P2:Real;margin:Real;stockvol:Real;stockunit:Real):Real
名称 | 类型 | 说明 |
---|
Option | Integer | 整数,组合保证金计算方式
值 |
计算方式 |
0 |
组合保证金为0 |
1 |
行权价之差×合约单位 |
2 |
Max(认购期权保证金,认沽期权保证金)+另一方期权结算价×合约单位 |
3 |
期权结算价*合约单位+期货保证金 |
4 |
X*成分合约卖持仓保证金,X指保证金系数 |
5 |
Min(行权价格之差*交易单位,空头期权保证金) |
|
OptionID | String | 字符串,期权组合成分合约1 |
Position | Integer | 整数,期权组合成分合约1头寸 |
OptionID2 | String | 字符串,期权组合成分合约2 |
position2 | Integer | 整数,期权组合成分合约2头寸 |
Price | Real | 实数,期权组合成份合约1价格 |
price2 | Real | 实数,期权组合成份合约2价格 |
StockPrice | Real | 实数,期权成分合约1和成分合约2标的证券价格 |
P1 | Real | 实数,期权保证金比例(%) |
P2 | Real | 实数,期权保证金比例Ⅱ(%) |
Margin | Real | 实数,保证金系数 |
Stockvol | Real | 实数,组合数量 |
Stockunit | Real | 实数,期权合约单位 |
返回 | Real | 期权组合保证金 |
//这两个合约构成认沽熊市价差策略PNSJC
//PNSJC组合策略的保证金计算方式是:两个期权合约的行权价之差
setsysparam(pn_date(),inttodate(20190731));
Option:=1;
OptionID:='OP10001902';
position:=1;
OptionID2:='OP10001906';
position2:=0;
Price:=spec(settlement(),OptionID);
price2:=spec(settlement(),OptionID2);
//两个期权合约标的物SH510050
StockPrice:=spec(close(),'SH510050');
P1:=12;
P2:=7;
margin:=0;
stockvol:=5;
stockunit:=10000;
return DepositOfOptionByGroup(Option,OptionID,position,OptionID2,position2,Price,price2,StockPrice,P1,P2,margin,stockvol,stockunit);
//结果:5000