m5:=ema(indexc,5);
m20:=ema(indexc,20);
mhyear:=ema(indexc,120);
myear:=ema(indexc,240);
DIFF:=EMA(CLOSE,short)-EMA(CLOSE,long);
DEA:=EMA(DIFF,m);
MACD:2*(DIFF-DEA),coloryellow;
STICKLINE(MACD0 and indexc>m20,0,MACD,4,1),COLORyellow;
STICKLINE(MACD>=REF(MACD,1) AND MACD>0 and indexc>m20 and m5>m20,0,MACD,4,1),COLORred;
STICKLINE(MACD>=REF(MACD,1) AND MACD>0 and (indexc
STICKLINE(MACD<=REF(MACD,1) AND MACD>0 and indexc
STICKLINE(MACD>REF(MACD,1) AND MACD<0 and mhyear>myear and (m5
STICKLINE(MACD>REF(MACD,1) AND MACD<0 and mhyear>myear and (m5>=m20 AND C>M20),0,MACD,4,1),COLORYELLOW;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 and mhyear
STICKLINE(MACD<0 and indexc>myear and indexc>m20 and m5>m20,0,MACD,4,1),COLORGREEN;
STICKLINE(MACD<0 and indexc>myear and (indexc
STICKLINE(MACD<0 and indexc
0,colorwhite;