SHORT:=12;
LONG:=26;
MID:=9;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
macd:(DIF-DEA)*2,COLORSTICK;
{底背离}
A1:=BArslAST(REF(crOSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
NOTEXT底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),DOTLINE,COLORRED;
{顶背离}
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND DIF<REF(DIF,A2+1) AND CROSS(DEA,DIF);
NOTEXT顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),DOTLINE,COLORGREEN;
DRAWICON(CROSS(DIF,DEA),DEA*1.08,38);{金叉}
DRAWICON(CROSS(DEA,DIF),DEA*1.08,39);{死叉}
DRAWICON(底背离,DEA*2.0,7);
DRAWICON(顶背离,DEA*2.0,8);

{
选股公式:

SHORT:=12;
LONG:=26;
MID:=9;
去停牌:=DYNAINFO(17)>0;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
底背离 AND 去停牌;
}

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