ZLCM:=EMA(WINNER(CLOSE)*70,3);{//主力筹码估算}
SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3);{//散户筹码估算}
ZSHTL:=SHCM/(ZLCM+SHCM)*100;{//散户套牢筹码比率}
ZZLKP:=ZLCM/(ZLCM+SHCM)*100;{//主力控盘筹码比率}
ZCMZL:=MA(ZLCM+SHCM,13);{//市场筹码总量}
ZZNTS:=BARSLAST(ZSHTL<90 AND REF(ZSHTL,1)>90);{//走牛天数}
ZSHJJ:=EMA(ZSHTL,89);{//散户警戒}
ZZLJJ:=EMA(ZZLKP,89);{//主力警戒}
ZJLRQD:=INTPART(ZZLKP-ZZLJJ);{//资金流入强度}
SH8:=EMA(ZSHTL,8);
DKB:=IF(ZZLKP-REF(ZZLKP,1)>ZSHTL-REF(ZSHTL,1),1,0);{//散户套牢筹码}
STICKLINE(ZZLJJ>REF(ZZLJJ,1),ZZLKP,20,3,0),COLOR00BBBB;
STICKLINE(ZZLJJ>REF(ZZLJJ,1),ZZLKP,20,2.5,0),COLOR00CCCC;
STICKLINE(ZZLJJ>REF(ZZLJJ,1),ZZLKP,20,2,0),COLOR00DDDD;
STICKLINE(ZZLJJ>REF(ZZLJJ,1),ZZLKP,20,1.5,0),COLOR00EEEE;
STICKLINE(ZZLJJ>REF(ZZLJJ,1),ZZLKP,20,1,0),COLOR00FFFF;
STICKLINE(ZZLJJ>REF(ZZLJJ,1),ZZLKP,20,0.5,0),COLOR00FFFF;
STICKLINE(ZSHTL>=90,ZZLKP,0,3,0),COLORFF0011;
STICKLINE(ZSHTL>=90,ZZLKP,0,2.5,0),COLORFF0022;
STICKLINE(ZSHTL>=90,ZZLKP,0,2,0),COLORFF0033;
STICKLINE(ZSHTL>=90,ZZLKP,0,1.5,0),COLORFF0044;
STICKLINE(ZSHTL>=90,ZZLKP,0,1,0),COLORFF0055;
STICKLINE(ZSHTL>=90,ZZLKP,0,0.5,0),COLORFF0066;
0,POINTDOT,COLORBLUE;
散户套牢:=INTPART(ZSHTL),COLORGREEN;
机构控盘:INTPART(ZZLKP),COLORRED;
JL:REF(机构控盘,1);
DRAWBAND(机构控盘,RGB(200,0,0),JL,RGB(0,200,0));
{IF(机构控盘<=REF(机构控盘,1),机构控盘,DRAWNULL),COLORBLUE,LINETHICK2;}
市场筹码总量:=INTPART(ZCMZL),COLORWHITE,NODRAW;
控盘线:20,COLORLIBLUE,DOTLINE,LINETHICK1;
高度控盘:40,COLORFF00FF,DOTLINE,LINETHICK1;
DRAWTEXT_FIX(C>O,0.01,0.01,0,'老牛量化道听图说'),COLORFF00FF;
DRAWTEXT(ISLASTBAR,20,'控盘线'),COLORGREEN;
DRAWTEXT(ISLASTBAR,40,'高度控盘'),COLORWHITE;