DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26)),COLORWHITE;
DEA:=(EMA(DIF,9)),COLORYELLOW;
MACD:(DIF-DEA)*2,COLORSTICK,COLORGREEN;
MACDX:=MACD;
TJG:=NOT(NAMELIKE('S') OR NAMELIKE('*S')) AND DYNAINFO(8)
VA1:=HHVBARS(MACDX,BARSLAST(MACDX 0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACDX),REF(VA1,1)+2),0.5);
TTX:=BARSLAST(VA2);
前高:DRAWLINE(VA2,MACDX,REF(VA2,1),REF(MACDX,1),1),DOTLINE;
黄柱:TTX AND MACDX REF(MACDX,TTX),NODRAW,COLORYELLOW;
{STICKLINE(黄柱,MACDX,前高,1,0),COLORYELLOW;
连续飘黄:BARSLASTCOUNT(黄柱),NODRAW,COLORYELLOW;
十日飘黄:COUNT(黄柱,10),NODRAW,COLORYELLOW;
}{www.9m8.cn 九毛八公式指标网}
VA3:=LLVBARS(MACDX,BARSLAST(MACDX 0)+1);
VA4:=CROSS(BACKSET(CROSS(MACDX,0),REF(VA3,1)+2),0.5);
BD:=BARSLAST(FILTERX(CROSS(0,MACDX),BARSCOUNT(C)));
前低:DRAWLINE(VA4,MACDX,REF(VA4,1),REF(MACDX,1),1),COLORGREEN,DOTLINE;
GT:=BARSLAST(VA2);
DT:=BARSLAST(VA4);
条件A:=VA2 AND MACDX REF(MACDX,REF(GT,1)+1);
条件B:=VA4 AND MACDX REF(MACDX,REF(DT,1)+1);
选股:=条件B AND COUNT(条件A,REF(DT,1))=1;
条件A1:=VA2 AND MACDX REF(MACDX,REF(GT,1)+1);
条件B1:=VA4 AND MACDX REF(MACDX,REF(DT,1)+1);
选股1:=条件B1 AND COUNT(条件A1,REF(DT,1))=1;
条件A2:=VA2 AND MACDX REF(MACDX,REF(GT,1)+1);
条件B2:=VA4 AND MACDX REF(MACDX,REF(DT,1)+1);
选股2:=条件B2 AND COUNT(条件A2,REF(DT,1))=1;
条件A3:=VA2 AND MACDX REF(MACDX,REF(GT,1)+1);
条件B3:=VA4 AND MACDX REF(MACDX,REF(DT,1)+1);
选股3:=条件B3 AND COUNT(条件A3,REF(DT,1))=1;
收敛三角:(CROSS(MACDX 前高 AND COUNT(选股,GT)=1,0.5) AND TJG)*MACDX,COLORWHITE;
上升旗形:(CROSS(MACDX 前高 AND COUNT(选股1,GT)=1,0.5) AND TJG)*MACDX ,COLORGREEN;
扩张三角:(CROSS(MACDX 前高 AND COUNT(选股2,GT)=1,0.5) AND TJG)*MACDX ,COLORYELLOW;
下降旗形:(CROSS(MACDX 前高 AND COUNT(选股3,GT)=1,0.5) AND TJG)*MACDX ,COLORCYAN;
MACDXT:收敛三角=MACDX OR 上升旗形=MACDX OR 扩张三角=MACDX OR 下降旗形=MACDX,NODRAW,COLORGRAY;