MACD背离3 通达信 副图 源码 指标公式
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK1;
DEA:EMA(DIF,9),COLORWHITE,LINETHICK1;
持仓段:=0,COLOR00CFFF;
空仓段:=0,COLORFFCCFF;
STICKLINE(DIF>DEA,-0.5,-0.6,1,1),COLOR00CFFF;
STICKLINE(DIF<DEA,-0.5,-0.6,1,1),COLORFFCCFF;
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(((MACD<REF(MACD,1)) AND (MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK1;
STICKLINE(((MACD>REF(MACD,1)) AND (MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK1;
建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK1;
加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK1;
白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK1;
趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK1;
AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1;
DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,0,0.03,1,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK1;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK1;
郑重声明:股市具有不确定性,个股走势是无法预测的。公式软件描述中的案例截图仅代表过去,仅供参考学习研究之用,不构成投资建议或未来保证,也并不能代表未来,依此操作,责任自负。股市有风险,入市需谨慎。
指标公式评论
(MACD背离3 通达信 副图 源码 指标公式)