SHORT:=12;
LONG:=26;
M:=9;
DIF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIF,M);
MACD : 2*(DIF-DEA),COLORSTICK;
STICKLINE(MACD>0 AND MACD>REF(MACD,1) ,0 ,MACD ,6,0),COLORRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1) ,0 ,MACD ,6,0),COLORYELLOW;
STICKLINE(MACD<0 AND MACD>REF(MACD,1) ,0 ,MACD ,6,0),COLORGREEN;
STICKLINE(MACD<0 AND MACD<REF(MACD,1) ,0 ,MACD ,6,0),COLORBLUE;