DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),COLORRED;
DEA : EMA(DIFF,MID);
MACD :2*(DIFF-DEA),STICK;
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,0.5,0),COLOR5454FF;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,0.5,0),COLORYELLOW;
STICKLINE(MACD<0 AND MACD<=REF(MACD,1),0,MACD,0.5,0),COLORFFFF54;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,0.5,0),COLORFF8000;
A:IF(DIFF<REF(DIFF,1),DIFF,DRAWNULL),COLORWHITE;