Chs:=bigorder(2,3);
Dhs:=(bigorder(2,2)-bigorder(2,3));
特买入:=chb;
特卖出:=chs;
大买入:=dhb;
大卖出:=dhs;
总成交量:=vol;
主力增仓:=(大买入+特买入)*总成交量;
主力减仓:=(大卖出+特卖出)*总成交量;
主力净买:=主力增仓-主力减仓;
主力增度:=主力增仓/总成交量;
主力减度:=主力减仓/总成交量;
主力活跃度:(主力增仓+主力减仓)/CAPITAL/2*100,linethick0;
买卖气:(主力净买/总成交量)*100,linethick0;
STICKLINE(主力净买>=0 and 买卖气=0,0,主力活跃度,8,0),color666666;
STICKLINE(主力净买>=0 and 买卖气>0 and 买卖气<20,0,主力活跃度,8,0),color000099;
STICKLINE(主力净买>=0 and 买卖气>=20 and 买卖气<40,0,主力活跃度,8,0),color000099;
STICKLINE(主力净买>=0 and 买卖气>=40 and 买卖气<60,0,主力活跃度,8,0),COLORRED;{
STICKLINE(主力净买>=0 and 买卖气>=60,0,主力活跃度,8,0),colorFF00FF;}
STICKLINE(主力净买<0 and 买卖气<=0 and 买卖气>-20,0,主力活跃度,8,0),color006633;
STICKLINE(主力净买<0 and 买卖气<=-20 and 买卖气>-40,0,主力活跃度,8,0),color00CC33;
STICKLINE(主力净买<0 and 买卖气<=-40,0,主力活跃度,8,0),COLOR00ff00;
N日飘红天数:=count(买卖气>0,10);
tt:=if(买卖气<0,1,0);
连续飘红:=BARSLAST(tt>0);
STR1:='【 '+'买卖气:'+NUMTOSTR(买卖气)+' '+'10日内'+NUMTOSTR(N日飘红天数)+'天做多'+' '+'最近'+NUMTOSTR(连续飘红)+'天连续飘红。】';
DRAWTEXTABS( 0,0 ,str1 ),COLORffffff;
V2:=IF(BARSTATUS=2,主力活跃度*240/CURRENTTIME/REF(主力活跃度,1)-1,主力活跃度/REF(主力活跃度,1)-1);