MACD背离副图指标
使用说明: 适用通达信软件使用,不同的软件使用要修改。
MACD背离副图指标,由MACD指标、MACD顶背离提示、MACD底背离提示、MACD金叉、均线金叉、成交量金叉、三金叉共振短线买点提示,趋势波段操作,
直接复制以下源代码,在公式管理器中新构建指标公用,复制进去就可以用了(仅供参考,下面有效果图,可以先看看指标显示出来效果如何):
DIF:EMA(C,8)-EMA(C,20);
DEA:EMA(DIF,7);
MACD:2*(DIF-DEA),COLORSTICK;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
DBL:=REF(C,A1 1)>C AND DIF>REF(DIF,A1 1) AND CROSS(DIF,DEA);
STICKLINE(DBL,0,0.03,6,0),COLOR3299CC;
DRAWTEXT(DBL,0.12,' 底背'),COLORGREEN;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
BDL:=REF(C,A2 1)<CLOSE AND REF(DIF,A2 1)>DIF AND CROSS(DEA,DIF);
STICKLINE(BDL,0,0.03,6,0),COLORRED;
DRAWTEXT(BDL,0.12,'顶背'),COLORRED;
M1:=MA(C,5);
M2:=MA(C,10);
AA:=CROSS(M1,M2);
AAA:=COUNT(AA,3)>=1;
T1:=MA(VOL,5);
T2:=MA(VOL,10);
BB:=CROSS(T1,T2);
BBB:=COUNT(BB,3)>=1;
DIFA:=EMA(C,10)-EMA(C,20);
DEAA:=EMA(DIFA,7);
MACDA:=(DIFA-DEAA)*2;
CC:=CROSS(DIFA,DEAA);
CCC:=COUNT(CC,3)>=1;
三金:=AAA AND BBB AND CCC;
三金叉:FILTER(三金,3),COLORFF00FF,NODRAW;
STICKLINE(三金叉,LLV(MACDA,200),0,0.01,0),COLORFF00FF;
DRAWTEXT(三金叉,LLV(MACDA,200),' 三金'),COLORFF00FF;
效果图: