以下是macd二进制指标改进版及选股公式

{MACD顶底背离}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;
 DEA:EMA(DIF,9),COLORYELLOW,NODRAW;
 MACD:(DIF-DEA)*2,COLORRED,NODRAW;
 NOTEXT1:HHV(DIF,34/3),COLORLIMAGENTA,LINETHICK1;
 NOTEXT2:LLV(DIF,34/3),COLORGREEN,LINETHICK1;
 SE:=DIF<NOTEXT1 AND DIF!=NOTEXT2 AND DIF<REF(DIF,1);
 BU:=DIF>NOTEXT2 AND DIF!=NOTEXT1 AND DIF>REF(DIF,1);
 CB:=DIF=NOTEXT2;
 CG:=DIF=NOTEXT1;
 S:IF(SE,DYNAINFO(7),DRAWNULL),COLORGREEN,NODRAW;
 B:IF(BU,DYNAINFO(7),DRAWNULL),COLORRED,NODRAW;
 D:=IF(CB,DYNAINFO(7),DRAWNULL),COLORGREEN,NODRAW;
 F:IF(CG,DYNAINFO(7),DRAWNULL),COLOR2693FF,NODRAW;

 {MACD二进制计算}
DIFF:=ABS(DIF);
 DEAA:=ABS(DEA);
 EJZ1:=DIFF-(2*DEAA),NODRAW;
 EJZ2:=DEAA-(2*DIFF),NODRAW;
 BNS:IF(DIFF>DEAA,EJZ1,EJZ2),COLORB18192,NODRAW;
 A:=LLV(MACD,50)=MACD;
 DRAWICON(A AND FILTERX(A,20), MACD,1);
 {MACD背离信号}
HBL:=REF(ZGZ,1)=REF(ZGZ,2);
 LBL:=REF(ZDZ,1)=REF(ZDZ,2);
 DRAWTEXT(HBL,ZGZ,’-‘),COLORBLUE;
 DRAWTEXT(LBL,ZDZ,’-‘),COLOR0099FF;
 STICKLINE(BU,0,0,5,1),COLORMAGENTA;
 STICKLINE(CG,0,0,5,1),COLORMAGENTA;
 STICKLINE(SE,0,0,5,1),COLORLICYAN;
 STICKLINE(CB,0,0,5,1),COLORLICYAN;
 {选股公式——-以下是单独的公式!}
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
 DEA:=EMA(DIF,9);
 MACD:=(DIF-DEA)*2;
 NOTEXT1:=HHV(DIF,34/3);
 NOTEXT2:=LLV(DIF,34/3);
 TJ1:=DIF>REF(DIF,1) AND DIF>0;
 XG:DIF>NOTEXT2 AND DIF!=NOTEXT1 AND TJ1;

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。