ma10:=ma(close,10);ma20:=ma(close,20);t1:=cross(close,ma20);t2:=low/ma10>=0.98 or low/ma10<=1.02;t3:=barslast(t1)<=5;xg:t2 and t3;注:突破20日均线的时间设为前5天内有突破信号。
n:=20;d:=5;boll:=ma(close,n);ub:=boll+2*std(close,n);lb:=boll-2*std(close,n);xg:count(range(c,lb,boll)=1,d) and lb>ref(lb,1) and ref(lb,1)<ref(lb,2);{d:为收盘价在中轨和下轨间运行天数(我设为5天,自己可改),下轨第一天转头向上时进行选股...