LONG:=20;SHORT:=10;M:=9;
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),colorred;
DEA : EMA(DIFF,M),COLORYELLOW;
MACD : 2*(DIFF-DEA), COLORSTICK;
PARTLINE(DIFF,DIFF<DEA),COLORGREEN;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2,0),COLORYELLOW;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2,0),COLORwhite;