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

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

2023-03-19未知 编 辑:掌上指标


公式源码:
 
信号的参数:1
 
DRAWGBK(C>0,RGB(0,150,150),RGB(0,00,100),0,' ',0),LINETHICK2;
 
0,LINETHICK2;
 
DIFF:EMA(CLOSE,6)-EMA(CLOSE,35)COLOR0080FF,LINETHICK2;
 
DEA:EMA(DIFF,5),LINETHICK2;
 
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;
 
DRAWICON(CROSS(DIFF ,DEA),DEA ,5);
 
DRAWTEXT(CROSS(DIFF,DEA) AND DIFF>0,DEA-0.05,'牛叉↙'),COLOR0080FF;
 
CROSS(MACD,0) AND MACD>0,LINETHICK2,COLORYELLOW;
 
DRAWTEXT(CROSS(DIFF,0) AND DIFF>0,DEA-0.05,'牛叉'),COLORCYAN;
 
低位金叉:=(CROSS(DIFF,DEA) AND DIFF<-0.1)*信号;
 
STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;
 
DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;
 
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0))*信号;
 
二次金叉:=(CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1)*信号;
 
STICKLINE(二次金叉,0,0.06,6,0)*信号,COLORFF00FF;
 
DRAWICON(二次金叉,DEA*0.9,1)*信号;
 
DRAWTEXT(二次金叉,-0.2,' 二次金叉')*信号,COLORYELLOW;
 
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1))*信号;
 
底背离:REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA)*信号,NODRAW;
 
STICKLINE(底背离,0,0.03,6,0)*信号,COLOR00FF00;
 
DRAWLINE(A1=0,DEA,底背离,DEA,0)*信号,COLORRED,LINETHICK2;
 
DRAWTEXT(底背离,DEA,' 底背离')*信号,COLORFF00FF;
 
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1))*信号;
 
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF)*信号;
 
DRAWLINE(A2=0,DEA,顶背离,DEA,0)*信号,COLORGREEN,LINETHICK2;
 
三全项:(低位金叉 AND 二次金叉 AND 底背离)*0.2*信号,COLORRED;
 
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0,'三全项')*信号;
 
DRAWTEXT(顶背离,DIFF,' 顶背离')*信号,COLORGREEN;
 
死叉收阳:CROSS(DEA,DIFF) AND CLOSE>OPEN,NODRAW;
 
DRAWTEXT(死叉收阳,DEA,'死叉')*信号,COLORCYAN;
大家都爱看
查看更多热点新闻
点击进入掌上指标资源网-下载各类指标