[PEL] 复制代码 variable:gsum=0;
variable:glong=0;
variable:glow=0;
DIFF := EMA(CLOSE,12) - EMA(CLOSE,26);
DEA := EMA(DIFF,9);
MACD := 2*(DIFF-DEA);
gnum:=barslast(ref(macd>0,1) and macd<0);
bnum:=barslast(ref(macd<0,1) and macd>0);
if ref(macd,1)>0 and macd<0 then
begin
gsum:=0;
glong:=0;
glow:=low;
end
if macd<0 then
begin
gsum:=gsum+macd;
if abs(macd)>abs(glong) then glong:=macd;
if low<glow then glow:=low;
end
numb:=max(gnum,bnum)+1;
con1:=abs(gsum)<abs(ref(gsum,numb));
con1.2:=abs(gsum)<(abs(ref(gsum,numb)))/2;
con2:=abs(glong)<abs(ref(glong,numb));
con3:=glow<ref(glow,numb);
选股1:all(macd<0,3) and ref(macd,1)<macd and ref(macd,1)<ref(macd,2) and con1.2 and con2 and con3;
选股2:ref(macd<0,1) and macd>0 and con1 and con2 and con3;
选股:选股1 or 选股2;
建议学习下基本语法。否则后续是无法更深入使用的。 |