沪A:=IF(CODELIKE('600') OR CODELIKE('601') OR CODELIKE('602') OR CODELIKE('603'),1,0);
深A:=IF(CODELIKE('000') OR CODELIKE('001'),2,0);
中小:=IF(CODELIKE('002'),3,0);
创业:=IF(CODELIKE('300') OR CODELIKE('301') OR CODELIKE('302') OR CODELIKE('303'),4,0);
期货:=IF(CODELIKE('IF'),5,0);
市场:MAX(MAX(沪A,MAX(深A,MAX(中小,创业))),期货),NODRAW;
指C:=IF(市场=1,"999999$CLOSE",IF(市场=2,"399001$CLOSE",IF(市场=3,"399005$CLOSE",IF(市场=4,"399006$CLOSE",IF(市场=5,"399300$CLOSE",0)))));
指数涨幅:(指C/REF(指C,1)-1)*100;
个股涨幅:(CLOSE/REF(CLOSE,1)-1)*100;
三十天指数:MA(指数涨幅,30);
三十天个股:MA(个股涨幅,30);