DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
STICKLINE(MACD<REF(MACD,1)AND CROSS(K,J),0,MACD,1,0),COLORFF3300;
STICKLINE(MACD>REF(MACD,1)AND CROSS(J,K),0,MACD,1,0),COLORRED;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
DRAWICON(MACD>REF(MACD,1) AND CROSS(J,K) AND CROSS(DIF,DEA),DEA*0.85,25);