
等级: 标准版
- 注册:
- 2022-6-27
- 曾用名:
|

楼主 |
发表于 2022-8-12 11:35
|
显示全部楼层
这样可以吗
//***********************************************
//开平仓
if 突破开多平空条件 then begin
sellshort(holding<0,holding,thisclose);
buy(holding=0,手数/2,thisclose);
end
if 突破开空平多条件 then begin
sell(holding>0,holding,thisclose);
buyshort(holding=0,手数/2,thisclose);
end
趋势多:=any(突破开多平空条件,ENTERBARS) and HOLDING>0;
趋势空:=any(突破开空平多条件,ENTERBARS) and HOLDING<0;
//***********************************************
//网格交易条件:
网格开多条件:=filcondwg and cross(c,bkprice) and t1;
网格开空条件:=filcondwg and cross(skprice,c) and t1;
网格平多条件:=cross(c,midprice) and not(趋势多) and holding>0;
网格平空条件:=cross(midprice,c) and not(趋势空) and holding<0;
//***********************************************
//网格交易
//开平仓
if 网格开多条件 and not(趋势空) then begin
sellshort(holding<0,holding,thisclose);
网格多:=buy(holding=0,手数,thisclose);
end
if 网格开空条件 and not(趋势多) then begin
sell(holding>0,holding,thisclose);
网格空:=buyshort(holding=0,手数,thisclose);
end |
|