MACD转折点,紫色柱体显示转折点 MACD面积(通达信公式 副图 源码 测试图)

[复制链接]
查看67 | 回复0 | 2022-6-27 14:52:56 | 显示全部楼层 |阅读模式

 MACD转折点
转折点的位置,用紫色柱体显示了。

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;
 

20225281056414987.png

20225281056414987.png

202252810555283176.rar

2.24 KB, 下载次数: 0

售价: 4 金钱  [记录]  [购买]

202252810555283176.rar

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则