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;