X_1:=V/CLOSE/2;
X_2:=SUM(IF(X_1>100 AND CLOSE>REF(CLOSE,1),X_1,0),0);
X_3:=SUM(IF(X_1>100 AND CLOSE<REF(CLOSE,1),X_1,0),0);
X_4:=SUM(IF(X_1<100 AND CLOSE>REF(CLOSE,1),X_1,0),0);
X_5:=SUM(IF(X_1<100 AND CLOSE<REF(CLOSE,1),X_1,0),0);
X_6:=X_2+X_3+X_4+X_5;
机买:X_2/X_6*100,COLORRED,LINETHICK2;
机卖:X_3/X_6*100,COLORGREEN,LINETHICK2;
散买:X_4/X_6*100,LINETHICK0;
散卖:X_5/X_6*100,LINETHICK0;
主力差:机买-机卖,NODRAW,LINETHICK2;
散户差:散买-散卖,NODRAW,LINETHICK0;
DRAWTEXT(主力差>0 AND REF(主力差,1)<=0,CLOSE*0.85,32),COLORRED;
DRAWTEXT(主力差<0 AND REF(主力差,1)>=0,(-CLOSE)*0.85,33),COLORWHITE;
DRAWTEXT(散户差>0 AND REF(散户差,1)<=0,CLOSE*0.15,34),COLORCYAN;
DRAWTEXT(散户差<0 AND REF(散户差,1)>=0,(-CLOSE)*0.15,35),COLORWHITE;
机构加仓:(主力差>=REF(主力差,1)+1.5)*50;