{阳胜进阴胜出主图公式:均线型、主图叠加}
真阴线:=C<=REF(C,1) AND C<=O;
假阳线:=C<=REF(C,1) AND C>=O;
阴线:=真阴线>0 OR 假阳线>0;
阴线天数:=BARSLAST(阴线);
阴线实体最高价:=MAX(REF(C,阴线天数),REF(O,阴线天数));
阴线成交量:=REF(V,阴线天数);
阳胜条件:=阴线天数>0 AND C>=阴线实体最高价 AND V>=阴线成交量;
阳胜:=IF(阳胜条件>0 AND REF(阳胜条件,1)=0,10,0);
真阳线:=C>=REF(C,1) AND C>=O;
假阴线:=C>=REF(C,1) AND C<=O;
阳线:=真阳线>0 OR 假阴线>0;
阳线天数:=BARSLAST(阳线);
阳线实体最低价:=MIN(REF(C,阳线天数),REF(O,阳线天数));
阳线成交量:=REF(V,阳线天数);
阴胜条件:=阳线天数>0 AND C<=阳线实体最低价 AND V>=阳线成交量*0.9;
阴胜:=IF(阴胜条件>0 AND REF(阴胜条件,1)=0,10,0),COLORWHITE;
阳胜进:=IF(阳胜>0,20,0),COLORRED;
阴胜出:=IF(阴胜>0,20,0);
DRAWTEXT(阳胜进>0,LOW*0.98,'阳'),COLOR00FFFF,LINETHICK3;
DRAWTEXT(阴胜出>0,HIGH*1.02,'阴'),COLORGREEN,LINETHICK3;
MA(CLOSE,N1);
MA(CLOSE,N2);
MA(CLOSE,N3);
MA(CLOSE,N4);
{参数N1、N2、N3、N4:取值1-300;推荐5、10、24、72}
|