【资料名称】:MACD背离金叉副图指标 源码 通达信介绍【资料描述】:
MACD背离金叉副图指标 源码 通达信
DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
DRAWICON(低位金叉,DEA*0.9,1) ;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWICON(二次金叉,DEA*0.9,5) ;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND
CROSS(DIFF,DEA);
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,-1,' 底背'),COLORRED;
DRAWICON(CROSS(DEA,DIFF),DIFF,2);
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,LINETHICK4;
DRAWTEXT(顶背离,1,' 顶背'),COLORGREEN;
三全项:=(低位金叉 AND 二次金叉 AND 底背离);
STICKLINE(三全项,0,0.8,1,0),COLORYELLOW,LINETHICK2;
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,1,'三全项'),COLORYELLOW;
MACD值:2*(DIFF-DEA),COLORSTICK,COLORRED;
VAR8:=SUM(MACD值,0);
VAR9:=IF(MAX(VAR8,REF(VAR8,2))<REF(VAR8,1) OR MIN(VAR8,REF(VAR8,2))>REF(VAR8,1),1,0);
VAR10:=BARSLAST(VAR9)+1;
VAR11:=VAR8-REF(VAR8,VAR10);
VAR12:=IF(MACD值>0,HHV(ABS(MACD值),VAR10),LLV(MACD值,VAR10));
VAR13:=MACD值/20;
红面积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLOR0000FF,NODRAW;
绿面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF00,NODRAW;
AA:=ROUND(REF(绿面积,1)*100);BB:=ROUND(REF(红面积,1)*100);
DRAWNUMBER(CROSS(0,MACD),HHV(REF(MACD,1),5)+0.03,ABS(BB)),COLORMAGENTA;
DRAWNUMBER(CROSS(MACD,0),LLV(REF(MACD,1),5)-0.03,ABS(AA)),COLORGREEN;
gd57564
【下载地址隐藏】: 点:回复可见地址