等级: 免费版
- 注册:
- 2021-8-13
- 曾用名:
|

楼主 |
发表于 2022-3-15 21:37
|
显示全部楼层
VARIABLE: ss:=1;
ma1:ma(c,5);
ma2:ma(c,10);
ma3:ma(c,44);
ma4:ma(c,65);
kd1:= ma1>ma2 and ma1 >ma3 and ma1 >ma4 and ma2 >ma3 and ma2 >ma4 and ma3 >ma4 ;
kk2:= ma1<ma2 and ma1 <ma3 and ma1 <ma4 and ma2 <ma3 and ma2 <ma4 and ma3<ma4;
KD:= kd1 ;
KK:= kk2 ;
PK:= cross(c,ma4) ;
PD:=cross(ma4,c) ;
if PK THEN
BEGIN
sellshort(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if PD THEN
BEGIN
sell(1,holding,MARKETR);
if NUMPROFIT(1)>0 then zz:=1;
if NUMPROFIT(1)<0 then zz:=zz+1;
end
if zz=1 then ss:=1;
if zz=2 then ss:=1;
if zz=3 then ss:=2;
if zz>=4 then ss:=4;
IF KD THEN BUY(holding=0,ss,MARKETR);
IF KK THEN BUYSHORT(holding=0,ss,MARKETR); |
|