R:=REF(C,1);
STH:=IF(FRACPART(R*1.051*100)>=0.5,0.01,0)+INTPART(R*1.051*100)/100;
STL:=IF(FRACPART(R*0.949*100)>=0.5,0.01,0)+INTPART(R*0.949*100)/100;
S:=NOT(H>STH OR L<STL);
NOS:=H>STH OR L<STL;
gws:=FRACPART(R*IF(NOS,10,5));
qz:=INTPART(R*IF(NOS,10,5))/100;
涨停价0:=R+qz+if(gws>0.5,0.01,0);
跌停价0:=R-qz-if(gws>0.5,0.01,0);
涨停价:INTPART(涨停价0)+INTPART(FRACPART(涨停价0)*100)/100+ROUND(FRACPART(FRACPART(涨停价0)*100))/100,COLORRED,LINETHICK;
跌停价:INTPART(跌停价0)+INTPART(FRACPART(跌停价0)*100)/100+ROUND(FRACPART(FRACPART(跌停价0)*100))/100,COLORGREEN,LINETHICK;
涨停0:=(C/R>=1.099 OR C/R*S>=1.049) AND C=H,LINETHICK1,COLORFF0080;
跌停0:=(C/R<=0.901 OR C/R*S<=0.951 AND C/R*S>0) AND C=L,LINETHICK1,ColorB4B400;
涨停1:=C>=涨停价-(MINDIFF) AND C<=涨停价+(MINDIFF) AND C=H,LINETHICK2;
跌停1:=C>=跌停价-(MINDIFF) AND C<=跌停价+(MINDIFF) AND C=L,LINETHICK2;
涨停:涨停0 OR 涨停1,LINETHICK2,COLORFF0080;
跌停:跌停0 OR 跌停1,LINETHICK2,ColorB4B400;
STICKLINE(ISLASTBAR,REF(CLOSE,1)*1.1,REF(CLOSE,1)*1.1,CLOSE,1,0),coloryellow;
STICKLINE(ISLASTBAR,REF(CLOSE,1)*0.9,REF(CLOSE,1)*0.9,C,1,0),colorcyan;
DRAWTEXT(ISLASTBAR,REF(CLOSE,1)*1.1,REF(CLOSE,1)*1.1,CLOSE,'价'),colorred,LINETHICK2;
DRAWTEXT(ISLASTBAR,REF(CLOSE,1)*0.9,REF(CLOSE,1)*0.9,C,'价'),colorgreen,LINETHICK2;