DIF:=EMA(CLOSE,12)-EMA(CLOSE,26),COLORFF80FF,LINETHICK1;
DEA:EMA(DIF,9),COLORRED,LINETHICK2;
macd:(DIF-DEA)*2,COLORSTICK;
0,COLORWHITE;
DIF2:EMA(CLOSE,8)-EMA(CLOSE,20),COLORGREEN,LINETHICK2;
A1:=BArslAST(REF(crOSS(DIF2,DIF),1));
A2:=BARSLAST(REF(CROSS(DIF2,DEA),1));
DB:=REF(C,A1+1)>C AND REF(DIF2,A1+1)<DIF2 AND REF(DIF2,1)<DIF2 AND DIF2<0;
DB2:=REF(C,A1+1)>C AND REF(DIF,A1+1)<DIF AND DIF<0 ;
DB3:=REF(C,A2+1)>C AND REF(DIF,A2+1)<DIF AND DIF<0 ;
STICKLINE(DB,DIF2,0,2,0),color00ffff;