程序化指标公式
问答中心

通达信MACD加强版副图指标公式

通达信指标 2019-10-14阅读量:3398

安装后如下图,友情提示(指标只是辅助,不作建议) 所有程序均为免费分享。

不会安装点击 安装指南 步骤操作。

DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:EMA(DIFF,9);

MACD:2*(DIFF-DEA), COLORSTICK;

低金:=CROSS(DIFF,DEA) AND DIFF<-0.1;

DRAWICON(低金,0.2,3);

DRAWTEXT(低金,0.2,'低金'),COLORBLACK;

JC:=BARSLAST(DEA>=0);

JCCOUNT:=COUNT(CROSS(DIFF,DEA),JC);

JC2:=COUNT(JCCOUNT=2,21)=1;

二金:=CROSS(DIFF,DEA) AND DEA<0 AND JC2;

DRAWICON(二金,0.4,7);

DRAWTEXT(二金,0.4,'二金'),COLOR4080FF;

A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));

底背离:REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),NODRAW;

DRAWICON(底背离,0,1);

DRAWTEXT(底背离,0,'底背离'),COLORBLUE;

A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));

顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);

DRAWTEXT(顶背离,DEA,'顶背离'),COLORBLUE;

DRAWICON(顶背离,DEA,2);

{需要编写选股关注微信公众号:程序化指标}

三金:低金 AND 二金 AND 底背离,NODRAW;

DRAWICON(三金,0.6,16);

DRAWTEXT(三金,0.6,'三金'),COLORRED,LINETHICK2;

红面积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLOR0000FF,NODRAW;

绿面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF00,NODRAW;

AA:=REF(绿面积,1)*100;

BB:=REF(红面积,1)*100;

DRAWNUMBER(CROSS(0,MACD),HHV(REF(MACD,1),5)+0.03,ABS(BB)),COLORRED;

DRAWNUMBER(CROSS(MACD,0),LLV(REF(MACD,1),5)-0.03,ABS(AA)),COLORBLUE;

JC3 := DEA-DIFF;

绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC3<0)),0);

红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC3>0)),0);

本次最低价:=LLV(L,BARSLAST(JC3<0));

本次最高价:=HHV(H,BARSLAST(JC3>0));

X1:=IF (MACD<0,BARSLAST(CROSS(DIFF,DEA)),0);

前次绿柱面积:=REF(绿柱面积,X1+1);

前次最低价:=REF(本次最低价,X1+1);

Y1:=IF((绿柱面积<0 AND ABS(绿柱面积) AND 本次最低价<前次最低价 ),1,0);

RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价 AND ABS(绿柱面积);

底背驰:IF(CROSS(DIFF,DEA),REF(Y1,1),0),NODRAW;

X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIFF)),0);

前次红柱面积:=REF(红柱面积,X2+1);

前次最高价:=REF(本次最高价,X2+1);

Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积 AND 本次最高价>前次最高价 ),1,0);

RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价 AND ABS(红柱面积);

顶背驰:IF(CROSS(DEA,DIFF),REF(Y2,1),0),NODRAW;

DRAWICON(底背驰,DEA,1);

DRAWTEXT(底背驰,DEA,'底背驰'),COLORRED;

DRAWICON(顶背驰,DIFF,2);

DRAWTEXT(顶背驰,DIFF,'顶背驰'),COLORBLUE;


版权声明

所有指标均为免费分享。

文章内容来自互联网,本网站无任何收费项目也不推荐股票
广告投放请自行识别风险。

分享:

扫一扫在手机阅读、分享本文

程序化指标公众号

左边广告一

关闭

右边广告二

关闭