当前位置:首页 > 免费资源 > 正文

「翔博精选指标」MACD背驰,和谐通达信源码分享 副图

2022-02-10原创 编 辑:翔博软件

{公式名称: MACD背驰


公式类型: 技术指标公式-其他类型
画线方法: 副图
公式源码:}
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),COLORSTICK,LINETHICK2;
VAR1:=CROSS(DIFF,DEA) AND DIFF<(-0.1);
STICKLINE(VAR1,0,0.08,6,0),COLORYELLOW;
DRAWTEXT(VAR1,0.16,44),COLORWHITE;
VAR2:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
VAR3:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(VAR2=2,21)=1;
STICKLINE(VAR3,0,0.06,6,0),COLORMAGENTA;
DRAWICON(VAR3,DEA*0.9,1);
DRAWTEXT(VAR3,DEA,45),COLORYELLOW;
VAR4:=BARSLAST(REF(CROSS(DIFF,DEA),1));
VAR5:=REF(CLOSE,VAR4+1)>CLOSE AND DIFF>REF(DIFF,VAR4+1) AND CROSS(DIFF,DEA);
STICKLINE(VAR5,0,0.03,6,0),COLORGREEN;
底背:DRAWLINE(VAR4=0,DEA,VAR5,DEA,0),COLORRED,LINETHICK4;
WWW70822COM:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
DRAWTEXT(VAR5,0.12,46),COLORMAGENTA;
VAR6:=BARSLAST(REF(CROSS(DEA,DIFF),1));
VAR7:=REF(CLOSE,VAR6+1)<CLOSE AND REF(DIFF,VAR6+1)>DIFF AND CROSS(DEA,DIFF);
顶背:DRAWLINE(VAR6=0,DEA,VAR7,DEA,0),COLORGREEN,LINETHICK4;
DRAWTEXT(VAR1 AND VAR3 AND VAR5,DIFF,47),COLORRED,LINETHICK2;
DRAWICON(CROSS(DIFF,DEA),DIFF,1);
DRAWICON(CROSS(DEA,DIFF),DIFF,2);
MACD值:2*(DIFF-DEA),COLORSTICK,COLORRED;
VAR8:=SUM(MACD值,0);
VAR9:=IF(MAX(VAR8,REF(VAR8,2))<REF(VAR8,1) OR MIN(VAR8,REF(VAR8,2))>REF(VAR8,1),1,0);
VAR10:=BARSLAST(VAR9)+1;
VAR11:=VAR8-REF(VAR8,VAR10);
VAR12:=IF(MACD值>0,HHV(ABS(MACD值),VAR10),LLV(MACD值,VAR10));
VAR13:=MACD值/20;
面积:VAR11,NODRAW;
DRAWNUMBER(REF(VAR13,1)>0 AND VAR13<=0,REF(VAR12,1),REF(面积,1)),COLORMAGENTA;
DRAWNUMBER(REF(VAR13,1)<0 AND VAR13>=0,REF(VAR12,1),REF(ABS(面积),1)),COLORGREEN;
DRAWNUMBER(ISLASTBAR AND VAR13<0,REF(VAR12,1),ABS(面积)),COLORMAGENTA;
DRAWNUMBER(ISLASTBAR AND VAR13>0,REF(VAR12,1),面积),COLORGREEN;

大家都爱看
查看更多热点新闻
点击进入翔博软件旗下掌上指标--自助下载指标