A1:(DVOL/C)/2,colorcyan,LINETHICK1;
A222:IF(A1>0.29 AND CLOSE>REF(CLOSE,1),A1,0),colorred,LINETHICK1;
A2:=SUM(IF(A1>100 AND CLOSE>REF(CLOSE,1),A1,0),0);
A3:=SUM(IF(A1>100 AND CLOSE<REF(CLOSE,1),A1,0),0);
A4:=SUM(IF(A1<100 AND CLOSE>REF(CLOSE,1),A1,0),0);
A5:=SUM(IF(A1<100 AND CLOSE<REF(CLOSE,1),A1,0),0);
A6:=A2+A3+A4+A5;
机买:(A2/A6)*100,colorred,LINETHICK1,NODRAW;
机卖:(A3/A6)*100,LINETHICK1,colorcyan,NODRAW;
散买:(A4/A6)*100,LINETHICK1,colormagenta,NODRAW;
散卖:(A5/A6)*60,LINETHICK1,colorgreen,NODRAW;
主力差:(机买-机卖)*60,coloryellow,LINETHICK1;
IF(主力差<= REF(主力差,1),主力差,DRAWNULL),colorlicyan,LINETHICK1;
IF(主力差> REF(主力差,1),主力差,DRAWNULL),coloryellow,LINETHICK1;
STICKLINE(主力差>REF(主力差,1),主力差,REF(A222,1),1,0),colorred;
STICKLINE(主力差<=REF(主力差,1),主力差,REF(A222,1),1,0),colorcyan;
STICKLINE(主力差<=REF(主力差,1),A1,REF(A222,1),0.5,0),colorlicyan;
{STICKLINE(主力差>REF(主力差,1),A1,REF(A222,1),0.5,0),colormagenta;}
T:=BARSCOUNT(A1);
STICKLINE(FILTER(CROSS(A1,REF(A222,1)),10),A1,主力差*0.99,1,0),colorwhite;
DRAWTEXT(FILTER(CROSS(A1,REF(A222,1)),10),A1*0.99,'S'),colorwhite;
STICKLINE(FILTER(CROSS(A222,REF(A1,1)),15),A222*0.99,主力差,1,0),coloryellow;
DRAWTEXT(FILTER(CROSS(A222,REF(A1,1)),15), A1,'B'),coloryellow;
DRAWTEXT(ISLASTBAR=1,A1,'S'),colorcyan;
DRAWTEXT(ISLASTBAR=1,A222,'B'),colorred;