通达信自己使用的MACD指标
以下是MACD指标源码
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD1:=2*(DIFF-DEA),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
DIFF,COLOR33FF33;
DEA,COLORYELLOW;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIFF>=DEA,DIFF,DRAWNULL),COLORRED,LINETHICK1;
弱:IF(DEA>=DIFF,DEA,DRAWNULL),COLORFF9900,LINETHICK1;
DRAWICON(CROSS(DIFF,DEA),DEA-0.02,1);
效果图如下;
使用的时候,只要红柱不消失,就可一直持有个股。