gspt1:=EMA(CLOSE,30);
gspt2:=EMA(CLOSE,900);
STICKLINE((gspt1>gspt2),gspt1,gspt2,0.8,0),COLORRED;
STICKLINE((gspt1<gspt2),gspt1,gspt2,0.8,0),COLORGREEN;
gspt3:=MAX(DYNAINFO(3),DYNAINFO(5));
gspt4:=MIN(DYNAINFO(3),DYNAINFO(6));
gspt5:=gspt3-gspt4;
gspt6:=gspt4+gspt5*7/8,COLORLIGREEN;
gspt7:=gspt4+gspt5*0.5/8,COLORLIMAGENTA;
gspt8:=(gspt7+gspt6)/2,COLORWHITE,POINTDOT;
gspt9:=SUM(V*C,0)/SUM(V,0),COLORYELLOW,DOTLINE;
gspt10:=CLOSE,COLORWHITE,LINETHICK2;
DRAWTEXT( ISLASTBAR AND gspt10,gspt10,STRCAT('←',CON2STR(gspt10,2))),COLORYELLOW;
STICKLINE(CROSS(gspt7,gspt10),gspt7,gspt8,1,0),COLORCC00FF;
STICKLINE(CROSS(gspt10,gspt6),gspt6,gspt8,1,0),COLOR33FF33;
DRAWTEXT(LONGCROSS(gspt7,gspt10,2),gspt7*1.001,'★买'),COLORFF66FF ;
DRAWTEXT(LONGCROSS(gspt10,gspt6,2),gspt6*0.999,'☆卖'),COLOR66FF33;
STICKLINE(C<gspt7,gspt7,C,2,0),COLORRED;
STICKLINE(CROSS(gspt7,gspt10),gspt7,(gspt7-gspt8)/5+gspt7,2,0),COLORYELLOW;
DRAWTEXT(CROSS(gspt7,gspt10),(gspt7-gspt8)/5+gspt7,'底'),COLORYELLOW;
STICKLINE(CROSS(gspt10,gspt6),gspt6,gspt6-(gspt7-gspt8)/5,2,0),COLORLIRED;
DRAWTEXT(CROSS(gspt10,gspt6),gspt6-(gspt7-gspt8)/5,'顶'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=8,gspt6+0.003,'顶'),COLORGREEN,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=8,gspt7-0.003,'底'),COLORLIRED,LINETHICK1;
DRAWTEXT(CURRBARSCOUNT=8,(gspt7+gspt6)/2,'中'),COLORWHITE,LINETHICK1;
gspt11:=V*C/100,NODRAW;
gspt12:=SUM((IF(((gspt11/8>20) AND (CLOSE>(REF(CLOSE,1)))),gspt11,0)),0);
gspt13:=SUM((IF(((gspt11/8>20) AND (CLOSE<(REF(CLOSE,1)))),gspt11,0)),0);
gspt14:=(gspt12+gspt13);
gspt15:=IF((ISLASTBAR),((100*gspt12)/gspt14),0);
gspt16:=IF((ISLASTBAR),((100*gspt13)/gspt14),0);
gspt17:=1;
gspt18:=STRCAT(STRCAT('机构买',CON2STR((100*gspt12)/gspt14,0)),'%');
gspt19:=STRCAT(STRCAT('机构卖',CON2STR((100*gspt13)/gspt14,0)),'%');
gspt20:=STRCAT(STRCAT('机构总买入',CON2STR((100*(gspt12-gspt13))/gspt14,0)),'%');
DRAWTEXT_FIX(gspt17=1,0,0.02,0,gspt18),COLORRED;
DRAWTEXT_FIX(gspt17=1,0,0.13,0,gspt19),COLOR00FF00;
DRAWTEXT_FIX(gspt17=1,0.88,1,0,gspt20),COLOR00FFFF;
gspt21:=BUYVOL*DYNAINFO(7)*100/10000 COLOR0000FF,NODRAW;
gspt22:=SELLVOL*DYNAINFO(7)*100/10000 COLOR00FF00,NODRAW;
gspt23:=ABS(gspt21)+ABS(gspt22)COLOR80FFFF,NODRAW;
gspt24:=ABS(gspt21)-ABS(gspt22)COLOR80FFFF,NODRAW;
gspt25:=ABS(gspt21)/gspt23*100;
gspt26:=ABS(gspt22)/gspt23*100;
TESTSKIP(NOT(gspt21 OR gspt22 OR gspt23 OR gspt24 OR gspt25 OR gspt26)!=0);
DRAWRECTREL(595,1000,795,940,RGB(0,128,0));
DRAWRECTREL(595,995,795,945,RGB(0,148,0));
DRAWRECTREL(595,990,795,950,RGB(0,168,0));
DRAWRECTREL(595,985,795,955,RGB(0,188,0));
DRAWRECTREL(595,980,795,960,RGB(0,208,0));
DRAWRECTREL(595,975,795,965,RGB(0,228,0));
DRAWRECTREL(595,970,795,970,RGB(0,248,0));
DRAWRECTREL(595,1000,595+gspt21*210/gspt23,940,RGB(128,0,0));
DRAWRECTREL(595,995,595+gspt21*210/gspt23,945,RGB(148,0,0));
DRAWRECTREL(595,990,595+gspt21*210/gspt23,950,RGB(168,0,0));
DRAWRECTREL(595,985,595+gspt21*210/gspt23,955,RGB(188,0,0));
DRAWRECTREL(595,980,595+gspt21*210/gspt23,960,RGB(208,0,0));
DRAWRECTREL(595,975,595+gspt21*210/gspt23,965,RGB(228,0,0));
DRAWRECTREL(595,970,595+gspt21*210/gspt23,970,RGB(248,0,0));
DRAWRECTREL(595+gspt21*210/gspt23,940,595+gspt21*210/gspt23,1000,RGB(128,0,0));
DRAWRECTREL(795,940,795,1000,RGB(0,0.0,10));
DRAWRECTREL(594.8,939.8,594.8,1000,RGB(0,0,10));
DRAWRECTREL(594.8,939.8,594.8,939.8,RGB(0,0,10));
DRAWRECTREL(594.8,1000,594.8,1000,RGB(0,0,10));
DRAWTEXT_FIX(1,0.54,0.89,0,STRCAT(STRCAT('',CON2STR(gspt21,1)),'万')),COLOR0000FF;
DRAWTEXT_FIX(1,0.785,0.89,0,STRCAT(STRCAT('',CON2STR(gspt22,1)),'万')),COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(gspt24)>0,0.65,0.89,0,STRCAT(' ',STRCAT(CON2STR(gspt24,1),'万'))) COLOR0000FF;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(gspt24)<0,0.65,0.89,0,STRCAT(' ',STRCAT(CON2STR(gspt24,1),'万'))) COLOR00FF00;
DRAWTEXT_FIX(CURRBARSCOUNT=1 AND(gspt24)=0,0.65,0.89,0,STRCAT(' ',STRCAT(CON2STR(gspt24,1),'万'))) COLOR80FFFF;
DRAWTEXT_FIX(1,0.8,0.98,0,STRCAT(STRCAT(' ',CON2STR(gspt26,1)),'%')),COLOR00FF00;
DRAWTEXT_FIX(1,0.54,0.98,0,STRCAT(STRCAT('',CON2STR(gspt25,1)),'%')),COLOR0000FF;
gspt27:=STRCAT('市盈率: ',CON2STR(C/FINANCE(33),2));
gspt28:=STRCAT(' 市销率: ',CON2STR(C/(FINANCE(20)/FINANCE(1)),2));
gspt29:=STRCAT(' 市净率: ',CON2STR(C/FINANCE(34),2));
gspt30:=STRCAT(' 净资收益率: ',CON2STR(FINANCE(33)/FINANCE(34)*100,2));
gspt31:=STRCAT(' 毛利率: ',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));
gspt32:=STRCAT(' 净利润率 ',CON2STR(FINANCE(30)/FINANCE(20)*100,2));
gspt33:=STRCAT(' 主营利润率 ',CON2STR(FINANCE(23)/FINANCE(20)*100,2));
gspt34:=STRCAT(' 利润同比: ',CON2STR(FINANCE(43),2));
gspt35:=STRCAT(' 收入同比: ',CON2STR(FINANCE(44),2));
gspt36:=(FINANCE(11)-FINANCE(15))/FINANCE(10)*1.2;
gspt37:=(FINANCE(31)+FINANCE(17))/FINANCE(10)*1.4;
gspt38:=FINANCE(23)/FINANCE(10)*3.3;
gspt39:=FINANCE(19)/FINANCE(15)*0.6;
gspt40:=FINANCE(20)/FINANCE(15)*0.999;
gspt41:=gspt36+gspt37+gspt38+gspt39+gspt40;
gspt42:=IF(gspt41<1.2,'重警',IF(gspt41>=1.2 AND gspt41<2.6,'轻警','无警'));
gspt43:=STRCAT('财务预警: ',STRCAT(gspt42,STRCAT('-Z值: ',CON2STR(gspt41,3))));
gspt44:=STRCAT(' 优质资产率: ',CON2STR((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19),2));
gspt45:=STRCAT(' 现金负债比: ',CON2STR(FINANCE(25)/FINANCE(15),3));
gspt46:=STRCAT('风险系数: ',STRCAT(STRCAT(gspt43,gspt44),gspt45));
DRAWTEXT_FIX(ISLASTBAR,0.025,0.96,0,gspt46),COLORCYAN;
gspt47:=YEAR AND MONTH AND DAY;
gspt48:=STRCAT(CON2STR(YEAR,0),'年');
gspt49:=STRCAT(CON2STR(MONTH,0),'月');
gspt50:=STRCAT(CON2STR(DAY,0),'日');
gspt51:=STRCAT('星期',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));
gspt52:=STRCAT(STRCAT(STRCAT(gspt48,gspt49),STRCAT(gspt50,gspt51)),'');
DRAWTEXT_FIX(gspt47,0.83,0,0,gspt52),COLORGREEN;