XG120:=EXTDATA_USER(1,0);{120天的RPS}
RPSXG120:=XG120/10;
XG250:=EXTDATA_USER(2,0);{250天的RPS}
RPSXG250:=XG250/10;
XG50:=EXTDATA_USER(3,0);{50天的RPS}
RPSXG50:=XG50/10;
XG11:=COUNT(C=HHV(C,250),5)>=1;{过去5天内至少有1个交易日的收盘价等于过去250天的最高收盘价}
XG12:=IF(RPSXG120<=95.99,0,1) OR IF(RPSXG250<=95.99,0,1);{RPS120大于96,或者RPS250大于96};
XG13:=IF(RPSXG120<=94.99,0,1) AND IF(RPSXG50<=94.99,0,1);{RPS120大于95,且RPS50大于95};
XG1:=XG11 AND (XG12 OR XG13);
XG21:=C/HHV(H,250)>=0.85;{收盘价大于一年内最高价0.85}
XG22:=IF(RPSXG120<=96.99,0,1) OR IF(RPSXG250<=96.99,0,1);{RPS120大于97,或者RPS250大于97};
XG2:=XG21 AND XG22;
XG31:=C/HHV(H,250)>=0.70;{收盘价大于一年内最高价0.70}
XG32:=IF(RPSXG120<=97.99,0,1) OR IF(RPSXG250<=97.99,0,1);{RPS120大于98,或者RPS250大于98};
XG3:=XG31 AND XG32;
XG4:=VOL/CAPITAL*100<20;{日线换手率小于20%}
(XG1 OR XG2 OR XG3) AND XG4;