以下是通达信MACD KDJ简单优化
通达信MACD KDJ简单优化
源码
DIF:(EMA(CLOSE,12) - EMA(CLOSE,26));
DEA:EMA(DIF,9);
MACD:=2*(DIF-DEA);{MACD}
IF(MACD>REF(MACD,1),MACD,DRAWNULL)STICK,COLORRED;
IF(MACD<REF(MACD,1),MACD,DRAWNULL)STICK,COLORCYAN;{MACD柱状}
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),NODRAW;
D:SMA(K,3,1),NODRAW;
J:3*K-2*D,NODRAW;{KDJ}
DRAWBAND(DIF,RGB(200,55,55),DEA,RGB(55,200,66));{带状 红多 绿空}
DRAWICON(CROSS(DEA,DIF) AND K<D,DEA,2); {}
DRAWICON(CROSS(DIF,DEA) AND COUNT(MACD>REF(MACD,1),2)=2 AND K>=D,DEA,1);