MACD背离公式
MACD背离公式 修改了参数 解决了MACD滞后和不灵敏
DIFF:EMA(CLOSE,8)-EMA(CLOSE,17);
DEA:EMA(DIFF,6);
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK1;
金叉:=CROSS(DIFF,DEA) ;
DRAWICON(金叉,0-0.001,1) ;
死叉:=CROSS(DEA,DIFF) ;
DRAWICON(死叉,0+0.001,2) ;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
底背买:DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,LINETHICK1;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
顶背卖:DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen,LINETHICK1;