DIFF:= EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA:= EMA(DIFF,9),COLORFFFF00;
MACD:= (DIFF-DEA)*2;
A1: BARSLAST(DIFF<REF(DIFF,1)),COLOR00FFFF,LINETHICK1;
A11: A1*-1,COLOR00FFFF,LINETHICK1;
A2: BARSLAST(DEA<REF(DEA,1)),COLORRED,LINETHICK1;
A22: A2*-1,COLORRED,LINETHICK1;
DRAWBAND(A2,RGB(150,50,20),A1,RGB(150,100,150));
DRAWBAND(A22,RGB(150,100,150),A11,RGB(150,50,20));
STICKLINE(CROSS(DIFF,DEA) AND DIFF<0,A11,0,2,0),COLORRED;
STICKLINE(CROSS(DIFF,DEA) AND DIFF>0,0,A1,2,0),COLORRED;
STICKLINE(CROSS(DEA,DIFF) AND DIFF<0,A11,0,2,0),COLORBLUE;
STICKLINE(CROSS(DEA,DIFF) AND DIFF>0,0,A1,2,0),COLORBLUE;