涨跌幅:=13;
净涨率:=25;
平均股价C:="880003$C";
均涨幅:(平均股价C/REF(平均股价C,1)-1)*100,NODRAW;
上涨家数:="999999$ADVANCE"+"399001$ADVANCE",NODRAW;
下跌家数:="999999$DECLINE"+"399001$DECLINE",NODRAW;
上涨率:(上涨家数)/(上涨家数+下跌家数)*100,NODRAW;
明预测:=IF((均涨幅>-涨跌幅/10 AND 上涨率>50-净涨率) OR (均涨幅>涨跌幅/10 AND 上涨率>50+净涨率),'上涨',IF((均涨幅<涨跌幅/10 AND 上涨率<50+净涨率) OR (均涨幅<-涨跌幅/10 AND 上涨率<50-净涨率),'下跌','平盘')),NODRAW;
今预测:IF(REF(明预测,1)='上涨',100,IF(REF(明预测,1)='下跌',-100,0)),DOTLINE,COLORLIBLUE;
今实际:IF(均涨幅>0,100,IF(均涨幅<0,-100,0)),COLORLIRED;
NOTEXT1:IF(今实际=今预测 AND 今预测=100,今预测,DRAWNULL),CIRCLEDOT,COLORMAGENTA,LINETHICK4;
NOTEXT2:IF(今实际=今预测 AND 今预测=-100,今预测,DRAWNULL),CIRCLEDOT,COLORGREEN,LINETHICK4;
NOTEXT3:IF(今实际!=今预测 AND 今预测=100,0,DRAWNULL),CROSSDOT,COLORRED,LINETHICK3;
NOTEXT4:IF(今实际!=今预测 AND 今预测=-100,0,DRAWNULL),CROSSDOT,COLORCYAN,LINETHICK3;
今结果:=IF(今实际=今预测,'正确','错误'),NODRAW;
BC:=BARSCOUNT(C),NODRAW;
准确率:SUM(今结果='正确',BC/2)/BC*2*100,COLORYELLOW;
准确率H:HHV(准确率,BC/2),NODRAW;
准确率L:LLV(准确率,BC/2),NODRAW;
准确率A:MA(准确率,BC/2),NODRAW;
上涨准确率占比:SUM(今预测=100 AND 今实际=100,BC)/SUM(今结果='正确',BC)*100,NODRAW;
下跌准确率占比:SUM(今预测=-100 AND 今实际=-100,BC)/SUM(今结果='正确',BC)*100,NODRAW;
DRAWTEXT_FIX(ISLASTBAR,0.99,0.01,1,VARCAT('昨日市场预测: ',REF(明预测,1))),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.99,0.12,1,VARCAT('昨日预测结果: ',今结果)),COLORLIRED;
DRAWTEXT_FIX(ISLASTBAR,0.99,0.23,1,VARCAT('明日市场预测: ',明预测)),COLORLIBLUE;