SHORT:=12;
LONG:=26;
MID:=9;
DIFF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIFF,MID);
macd:(DIFF-DEA)*2,LINETHICK0;
STICKLINE(MacD>0,MACD,0,-1,1),COLORRED;
STICKLINE(MACD<0,MACD,0,-1,0),COLORCCCC00;
DRAWICON(ISLASTBAR=1 AND MACD>REF(MACD,1),HHV(MACD,42),1);
DRAWICON(ISLASTBAR=1 AND MACD
VAR1:=HHV(DEA,42);
VAR2:=LLV(DEA,42);
VAR3:=DEA-(DIFF-DEA);
VAR4:=DEA-(DIFF-DEA);
UP:IF(DIFF>VAR1 AND DEA=VAR1,MAX(LLV(VAR1,10),VAR3),VAR1),COLORBB9A00;
DN:IF(DIFF