Dif:=EMA(NEW,6) - EMA(NEW,21);
diff:=EMA(dif,6);
dea:=MA(diff,6);
zero:0;
MB:=dea-REF(dea,1);
PARTLINE(dea,dea>REF(dea,1),RGB(255,0,255),dea
A1:=BArslAST(REF(crOSS(Mb,0),1));
b1:=REF(NEW,A1+1)>NEW AND REF(dEA,A1+1)
c1:=BARSLAST(REF(CROSS(0,Mb),1));
d1:=REF(NEW,c1+1)
DRAWTEXT(IF(d1>0,1,0),dea,'macd顶背'),colormagenta;