DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIFF,9); MACD0:=(DIFF-DEA)*2; A:=BARSLAST(REF(CROSS(DEA,DIFF),1)); 顶背离:=REF(CLOSE,A+1)<CLOSE AND REF(DIFF,A+1)>DIFF AND CROSS(DEA,DIFF); B:=COUNT(顶背离,5)>0; NOT(B); 或者
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIFF,9); MACD0:=(DIFF-DEA)*2; A:=BARSLAST(REF(CROSS(DEA,DIFF),1)); 顶背离:=REF(CLOSE,A+1)<CLOSE AND REF(DIFF,A+1)>DIFF AND CROSS(DEA,DIFF); COUNT(顶背离,5)=0;
|