A1:=(Dvol/C)/2,NODRAW;
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;
A7:=IF((BARSTATUS=2),((100*A2)/A6),0);
A8:=((IF((BARSTATUS=2),((100*A3)/A6),0)));
A9:=((IF((BARSTATUS=2),((100*A4)/A6),0)));
A10:=((IF((BARSTATUS=2),((100*A5)/A6),0)));
机构买盘:=(A2),LINETHICK2;
机构卖盘:=(A3),LINETHICK2;
散户买盘:=(A4);
散户卖盘:=(A5);
机构买:=(A2),LINETHICK6,COLORRED;
机构卖:=(A3),LINETHICK6,COLORGREEN;
DD1:=1;
AAA1:=STRCAT(STRCAT('机构买',CON2STR((100*A2)/A6,0)),'%');
AAA2:=STRCAT(STRCAT('机构卖',CON2STR((100*A3)/A6,0)),'%');
AAA3:=STRCAT(STRCAT('净买入',CON2STR((100*(A2-A3))/A6,0)),'%');
DRAWTEXT_FIX(DD1=1,0,0.04,0,AAA1),COLORRED;
DRAWTEXT_FIX(DD1=1,0,0.12,0,AAA2),COLORGREEN;
DRAWTEXT_FIX(DD1=1,0,0.20,0,AAA3),COLOR00FFFF;
VAR0:HHV(H,480),DOTLINE,COLORCYAN;
VAR1:=DATETODAY(DATE)-DATETODAY(REF(DATE,TOTALBARSCOUNT-CURRBARSCOUNT))+1;
VAR2:=BARSLAST((VAR1-REF(VAR1,1))!=WEEkdAY-REF(WEEKDAY,1) OR TOTALBARSCOUNT-CURRBARSCOUNT=0)+1;
VAR3:=REF(C,VAR2);
VAR4:=REF(VAR3,VAR2);
VAR5:=REF(VAR4,VAR2);
VAR6:=REF(VAR5,VAR2);
VAR7:=REF(VAR6,VAR2);
VAR8:=REF(VAR7,VAR2);
VAR9:=REF(VAR8,VAR2);
VAR10:=REF(VAR9,VAR2);
VAR11:=REF(VAR10,VAR2);
VAR12:=MAX(DYNAINFO(3),DYNAINFO(5));
VAR13:=MIN(DYNAINFO(3),DYNAINFO(6));
VAR14:=VAR12-VAR13;
VAR15:VAR13+VAR14*8/9,COLORLIRED,DOTLINE;
VAR16:VAR13+VAR14*0.5/9,COLORGREEN,DOTLINE;
VAR17:IF(BETWEEN(C/(SUM(AMOUNT,0)/SUM(VOL*100,0)),1.05,0.95)=0,MA(C,0),(SUM(AMOUNT,0)/SUM(VOL*100,0))),COLORYELLOW,DOTLINE;
VAR18:=(EMA(CLOSE,12)-EMA(CLOSE,26))+DYNAINFO(3);
VAR19:=EMA(VAR18,9);
VAR20:=10*(VAR18-VAR19);
VAR21:=EMA(VAR20,2);
STICKLINE(VAR20>=VAR21 AND VAR20>=0,DYNAINFO(3),VAR20+DYNAINFO(3),0,-1),COLORLIGRAY;
STICKLINE(VAR20<VAR21 AND VAR20>0,DYNAINFO(3),VAR20+DYNAINFO(3),0,-1),COLORLICYAN;
STICKLINE(VAR20>=VAR21 AND VAR20<0,DYNAINFO(3),VAR20+DYNAINFO(3),0,-1),COLORLIGRAY;
STICKLINE(VAR20<VAR21 AND VAR20<0,DYNAINFO(3),VAR20+DYNAINFO(3),0,-1),COLORLIGREEN;
VAR22:=SUM(AMOUNT,BARSCOUNT(CLOSE))/SUM(V*100,BARSCOUNT(CLOSE));
VAR23:=expma(CLOSE/VAR22,20);VAR24:=EXPMA(CLOSE/VAR22,60);VAR25:=EXPMA(CLOSE/VAR22,120);
VAR26:=1;1.022,NODRAW;VAR27:=1.033;
DRAWTEXT(crOSS(VAR23,1.02),C*0.999,' 拉'),COLORMAGENTA,LINETHICK9;
DRAWICON(CROSS(VAR23,1.04),C,45);
DRAWTEXT(CROSS(VAR23,1.04),C*0.999,' 冲'),COLORRED,LINETHICK9;
VAR28:=(VOL/CLOSE)/3;
VAR29:=SUM((IF(((VAR28>40) AND (CLOSE>(REF(CLOSE,1)))),VAR28,0)),0);
VAR30:=SUM((IF(((VAR28>40) AND (CLOSE<(REF(CLOSE,1)))),VAR28,0)),0);
VAR31:=SUM((IF(((VAR28<40) AND (CLOSE>(REF(CLOSE,1)))),VAR28,0)),0);
VAR32:=SUM((IF(((VAR28<40) AND (CLOSE<(REF(CLOSE,1)))),VAR28,0)),0);
VAR33:=((VAR29+VAR30)+VAR31)+VAR32;
VAR34:=IF((BARSTATUS=2),((100*VAR29)/VAR33),0);
VAR35:=((IF((BARSTATUS=2),((100*VAR30)/VAR33),0)));
VAR36:=((IF((BARSTATUS=2),((100*VAR31)/VAR33),0)));
VAR37:=((IF((BARSTATUS=2),((100*VAR32)/VAR33),0)));
DRAWTEXT(LONGCROSS(VAR16,C,2),C-0.01,'满仓买入'),COLORRED,LINETHICK9;
DRAWICON(LONGCROSS(VAR16,C,2),C-0.01,1);
STICKLINE(LONGCROSS(VAR16,C,2),C,VAR15,0,-1),COLORCYAN;
DRAWTEXT(LONGCROSS(C,VAR15,2),C+0.01,'卖出'),COLORGREEN,LINETHICK9;
DRAWICON(LONGCROSS(C,VAR15,2),C+0.01,45);