通达信MACD控盘副图指标
通达信MACD控盘副图指标
源码
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;
DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(((MACD < REF(MACD,1)) AND (MACD > 0)),0,MACD,1,0),LINETHICK2,COLOR00FFFF;
STICKLINE(((MACD > REF(MACD,1)) AND (MACD < 0)),0,MACD,1,0),LINETHICK2,COLORFF00FF;
DRAWTEXT(CROSS(DIF,DEA),DIF-0.3,'金叉'),COLORRED;
DRAWTEXT(CROSS(DEA,DIF),DIF+0.3,'死叉'),COLORYELLOW;
IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;
IF(DIF<0,0,DIF),COLORRED,LINETHICK2;
IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;
IF(DIF>DEA,DEA,DEA),{COLORGREEN}COLORFF937F,LINETHICK2;
{缩头:=IF(MACD>0 AND REF(MACD,1)>REF(MACD,2) AND MACD< REF(MACD,1),1,0);
缩脚:=IF(MACD<0 AND REF(MACD,1)< REF(MACD,2) AND MACD>REF(MACD,1),1,0);
阻力:=IF(CROSS(C,MA(C,20)) OR CROSS(C,MA(C,60)),1,0);
支撑:=IF(CROSS(MA(C,20),C) OR CROSS(MA(C,60),C),1,0);
做多:=IF(CROSS(MACD,DIF) AND DIF>0 AND MACD>0,1,0);
放空:=IF(CROSS(DIF,MACD) AND DIF<0 AND MACD<0,1,0);
DRAWTEXT(FILTER(缩头,3) AND 缩头,MACD+0.1,'▼'),COLORFF00FF;
DRAWTEXT(FILTER(缩脚,3) AND 缩脚,MACD,'△'),COLOR00FF00;
DRAWTEXT(FILTER(阻力,16) AND MACD>=0,MACD+0.01,'¤阻力'),COLOR00FFFF;
DRAWTEXT(FILTER(支撑,16) AND MACD<0,MACD,'¤支撑'),COLORFFFFFF;
A4:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A4+1)>C AND REF(DIF,A4+1)<DIF AND CROSS(DIF,DEA);
DRAWTEXT(FILTER(B1>0,5),DIF+0.2,'●背离'),COLORYELLOW;}
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;
DRAWTEXT(顶背离,0.25,' ★顶背离'),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,6,0),COLOR00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK1;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
- 上一篇公式:奉献精品 绝密三趋势【抓牛指标 主图 源码 说明】
- 下一篇公式:通达信看图解势副图指标