{SVSH - 散户线模型}
input:p1(7);
variable:散户帐号数=0;
参数:=min(1-(h-c)/c,1-(c-l)/c,1-(h-l)/c);
TOP散户:=TOPVIEW(1360)+TOPVIEW(1361);
T1:=topview(1430);
T2:=topview(1431);
T3:=topview(1432);
T4:=topview(1433);
s1:=(t1-ref(t1,1));
s7:=(t1-ref(t1,p1));
bb:=if(order(1)-order(2)>=0,pow(abs((order(1)-order(2))*参数),0.8),0-pow(abs((order(1)-order(2))*参数),0.8));;
aa:=INTPART(max(min(散户帐号数+bb,capital/8),capital/2000));
散户帐号数:if(TOPVIEW(1400,0,1)<>0,TOP散户,aa),PRECIS0,linethick2;
drawmovetext(s7>0,numtostr(p1)+'日内散户增仓占'+numtostr(s7)+'%'),colorgreen;
drawmovetext(s7<0,numtostr(p1)+'日内散户减仓占'+numtostr(abs(s7))+'%'),colorred;
drawflagtext(s1>1,散户帐号数,'散户当日增仓占流通盘的'+NUMTOSTR(s1)+'%'),colorgreen;
drawflagtext(s1<-1,散户帐号数,'散户当日减仓占流通盘的'+NUMTOSTR(abs(s1))+'%'),colorred;
DRAWGBK((topview(1400,0,10)-ref(topview(1400,0,10),1))<>0 and STRCMP(STKLABEL,'000001')<>0 and capital<>0),COLOR484848;
drawmovetext((topview(1400,0,10)-ref(topview(1400,0,10),1))>0,'流通A股增加了'+NUMTOSTR((topview(1400,0,10)-ref(topview(1400,0,10),1))/10000)+'万股'),coloryellow;
drawmovetext((topview(1400,0,10)-ref(topview(1400,0,10),1))<0,'流通A股减少了'+NUMTOSTR((ref(topview(1400,0,10),1)-topview(1400,0,10))/10000)+'万股'),coloryellow;