M:=2;
持增日:=1;
N:=-80;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
macd:=(DIF-DEA)*2;
金叉1:= crOSS(DIF,DEA) AND DIF<= M AND DEA<=M ;
持增:=LAST(MacD>REF(MACD,1),持增日,0) AND DIF>REF(DIF,1);
CS:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
YJD:= (EMA(CS,3)-50)*2;
YJF:=MA(YJD,5);
金叉2:=CROSS(YJD,YJF) AND YJD<=N AND YJF<=N;
选股:金叉1 AND 金叉2 OR 金叉1 AND YJD>YJF AND YJD>REF(YJD,1) AND YJD<=N AND YJF<N
OR 金叉2 AND DIF>DEA AND DIF>REF(DIF,1) AND DIF<=M AND DEA<=M
OR 持增 AND 金叉2 ;