怎样在通达信里统计 A股一年内所有个股涨停的总次数,用什么函数? 如果知道上面的的, 应该也可以统计出满足某一条件的个股涨停次数。 请高人指点一下。谢谢!
爱约股解答:
{以下涨停黄柱,涨幅>5%橙柱、跌停绿柱}
C2:=REF(C,1);
非ST涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
涨停:=非ST涨停;
STICKLINE(涨停,OPEN,CLOSE,2,0),COLOR00FFFF;
STICKLINE(涨停,H,L,0,0),COLOR00FFFF;
非ST跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);
跌停:=非ST跌停;
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;
半涨1:=IF((C-C2)*100/C2>=(5-0.01*100/C2),1,0);
半涨2:=IF((C-C2)*100/C2<(10-0.01*100/C2),1,0);
JRS:=半涨1 AND 半涨2 AND FINANCE(33)>0;
STICKLINE(JRS,OPEN,CLOSE,2,0),COLOR0066FF;
STICKLINE(JRS,H,L,0,0),COLOR0066FF;
NUMBER:=COUNT(非ST涨停,BARSSINCE(非ST涨停)+1);
DRAWNUMBER(非ST涨停,HIGH*1.04,NUMBER),COLORWHITE;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.56,0.02,0,NUMBER),COLORWHITE;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.45,0.02,0,'上市以来共涨停'),COLORYELLOW;