等级: 免费版
- 注册:
- 2021-12-11
- 曾用名:
|

楼主 |
发表于 2022-5-9 15:44
|
显示全部楼层
//如果当前品种有挂单或者理论策略的当根k理论持仓有变化,就不执行
if is_order or (ho1<>before_ho1) then exit;
else
BEGIN
//多头部分
//理论持仓大于0,补仓
if ho1>0 and ho1>tbuyho then
BEGIN
tbuy(1,ho1-tbuyho,mkt);
END
//理论持仓大于0,减仓
if ho1>=0 and ho1<tbuyho then
BEGIN
tsell(1,tbuyho-ho1,mkt);
END
//空头部分
//理论持仓小于0,补仓
if ho1<0 and abs(ho1)>tsellho then
BEGIN
tbuyshort(1,abs(ho1)-tsellho,mkt);
END
//理论持仓小于0,减仓
if ho1<=0 and abs(ho1)<tsellho then
BEGIN
tsellshort(1,tsellho-abs(ho1),mkt);
END
END |
|