A1:=C>REF(C,4);
A2:=BARSLASTCOUNT(A1);
A3:=REF(A2,1)=8 AND A2>REF(A2,1);
A4:=REF(BETWEEN(A2,5,8),1) AND A2<REF(A2,1);
A5:=ISLASTBAR AND BETWEEN(A2,6,8);
A6:=(BACKSET(A3>0,9) OR BACKSET(A4>0,A2+1)*0 OR BACKSET(A5>0,A2))*A2;
DRAWTEXT(A6>0,H+H*0.02,VAR2STR(A6,0)),COLORFF00FF;
DRAWTEXT(A2=9,H+H*0.02,'9'),COLOR00FF00;
B1:=C<REF(C,4);
B2:=BARSLASTCOUNT(B1);
B3:=REF(B2,1)=8 AND B2>REF(B2,1);
B4:=REF(BETWEEN(B2,5,8),1) AND B2<REF(B2,1);
B5:=ISLASTBAR AND BETWEEN(B2,6,8);
B6:=(BACKSET(B3>0,9) OR BACKSET(B4>0,B2+1)*0 OR BACKSET(B5>0,B2))*B2;
DRAWTEXT(B6>0,L-L*0.02,VAR2STR(B6,0)),COLOR00FF00;
DRAWTEXT(B2=9,L-L*0.02,'9'),COLORFF00FF;
{左上角文字}
DRAWTEXT_FIX(1,0.02,0.115,0,'所属行业地域概念:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.13,0.115,0,HYBLOCK),COLOR0000FF;{所属行业}
DRAWTEXT_FIX(1,0.18,0.115,0,DYBLOCK),COLORFF00FF;{所属地域}
DRAWTEXT_FIX(1,0.23,0.115,0,GNBLOCK),COLOR0088FF;{所属概念}
DRAWTEXT_FIX(1,0.02,0.17,0,'所属风格板块:'),COLOR00FFAA;
DRAWTEXT_FIX(1,0.10,0.17,0,FGBLOCK),COLOR00FFFF;{所属风格板块};
{控盘系数}
ZLCM:=EMA(WINNER(CLOSE)*70,3);{//主力筹码估算}
SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3);{//散户筹码估算}
ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{//主力控盘筹码比率}
控盘系数%:=INTPART(ZZLKP),NODRAW;
高度控盘:=CROSS(控盘系数%,50);
DRAWTEXT_FIX(1,0.02,0.23,0,STRCAT('控盘系数%:',CON2STR(控盘系数%,2))),COLORYELLOW;