FuturesFeeAmount
简述
获得指定日期货合约手续费(元/手),与系统参数(期货合约代码)相关
futuresfeeamount(endt:date;feeamounttype:usrdefine):real
名称 | 类型 | 说明 |
---|
endt | date | 指定日, |
feeamounttype | usrdefine | 手续费类型
显示值 |
取值 |
开仓手续费(元/手) |
0 |
平仓手续费(元/手) |
1 |
短线开仓手续费(元/手) |
2 |
短线平仓手续费(元/手) |
3 |
|
返回 | real | real: |
范例一:
//计算cu1404 在2014年3月28日的开仓手续费(元/手)。
setsysparam(pn_stock(),"cu1404");
return FuturesFeeAmount(inttodate(20140328),0);
//结果:0 (元/手)
范例二:
//根据期货手续费(交易额万分之)和期货手续费(元/手)计算cu1404 在2014年3月28日交易手续费。
vol1:=10; //交易张数
price:=3000; //交易价格
setsysparam(pn_stock(),"cu1404");
contractunit:=base(703007); //合约乘数
//期货手续费(金额法)
FeeRate:=FuturesFeeRate(inttodate(20140328),0);
Fee1:=(vol1*price*contractunit)/10000*FeeRate;
//期货手续费(数量法)
FeeAmount:=FuturesFeeAmount(inttodate(20140328),0);
Fee2:=vol1*FeeAmount;
return Fee1+Fee2;
//结果:7.5(元)