当前位置:首页 > 通达信 > 正文

【通达信源码分享】精品指标公式-MACD转折点指标源码

2022-10-19未知 编 辑:掌上指标


公式源码:
 
DIFF:(EMA(C,12)-EMA(C,26))*20,COLORWHITE,LINETHICK1;
 
DEA:EMA(DIFF,9),COLORYELLOW,LINETHICK1;
 
MACD1:2*(DIFF-DEA),NODRAW;
 
MACD2:=EMA((3*MACD1+2*REF(MACD1,1)+REF(MACD1,2))/6,1);
 
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,0,0),COLORRED;
 
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,2,0),COLORMAGENTA;
 
STICKLINE(MACD1<MACD2,0,MACD1,0,0),COLORCYAN;
 
STICKLINE(MACD1>0 AND MACD1<=REF(MACD1,1),0,MACD1,0,1),COLORRED;
 
金叉:=CROSS(DIFF,DEA) AND DIFF<0;
 
DRAWTEXT(金叉,0,' 金叉'),COLORWHITE;
 
金叉1:=CROSS(DIFF,DEA) AND DIFF>=0;
 
DRAWTEXT(金叉1,0,' 金叉'),COLORYELLOW;
 
红柱面积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLORRED,NODRAW;
 
绿柱面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORGREEN,NODRAW; 
 
DIF1A:=EMA(CLOSE,12)-EMA(CLOSE,26);
 
DEA1A:=EMA(DIF1A,9);
 
MACDA:=(DIF1A-DEA1A)*2*60;
 
低位金叉:=CROSS(DIF1A,DEA1A) AND DIF1A<-0.1;
 
JCCOUNT:=COUNT(CROSS(DIF1A,DEA1A),BARSLAST(DEA1A>=0));
 
二次金叉:=CROSS(DIF1A,DEA1A) AND DEA1A<0 AND COUNT(JCCOUNT=2,21)=1;
 
A101:=BARSLAST(REF(CROSS(DIF1A,DEA1A),1));
 
底背离:=REF(CLOSE,A101+1)>CLOSE AND DIF1A>REF(DIF1A,A101+1) AND CROSS(DIF1A,DEA1A);
 
DRAWTEXT(底背离,-3.5,'背离'),COLORYELLOW;
大家都爱看
查看更多热点新闻
点击进入掌上指标资源网-下载各类指标