通达信MACD底顶背离源码副图

[复制链接]
查看26 | 回复0 | 2022-7-24 03:48:51 | 显示全部楼层 |阅读模式

DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)<0 AND MACD>0);
MACD金叉天数:=REF(QZQ,1);
股价新低:=L=LLV(L,QZQ+10);
低7:=COUNT(股价新低,7)>0;
DIFF最低:=LLV(DIFF,QZQ-2)>LLV(DIFF,QZQ+10);
DIF非新低:=REF(DIFF最低,1);
底背离1:=低7 AND DIF非新低 AND CROSS(DIFF,DEA) AND COUNT(CROSS(DEA,DIFF),5)<2,COLORRED;
底背离:IF(底背离1,0.5,0),COLORRED,LINETHICK2;
EJ:=REF(COUNT(底背离1,QZQ+1)=1,1) AND CROSS(DIFF,DEA) AND DIFF<0;
黄金叉:IF(EJ,0.7,0),COLORMAGENTA,LINETHICK2;
QSC:=BARSLAST(REF(MACD,1)>0 AND MACD<0);
MACD死叉天数:=REF(QSC,1);
股价新高:=H=HHV(H,QSC+10);
高7:=COUNT(股价新高,7)>0;
DIFF最高:=HHV(DIFF,QSC-2)<HHV(DIFF,QSC+10);
DIF非新高:=REF(DIFF最高,1);
顶背离1:=高7 AND DIF非新高 AND CROSS(DEA ,DIFF) AND COUNT(CROSS(DIFF,DEA),5)<2,LINESTICK;
顶背离:IF(顶背离1,0.5,0),COLORYELLOW,LINETHICK2;
DRAWTEXT(顶背离1,0.4,'顶背离'),COLORLIBLUE;
DRAWTEXT(底背离1,0.4,'底背离'),COLORMAGENTA;
DRAWTEXT(EJ,0.6,'黄金叉'),COLORMAGENTA;

641455157.jpg

641455157.jpg

641500553.jpg

641500553.jpg

回复

使用道具 举报

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

本版积分规则