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天内有突破信号。
a1:=barslast(c/ref(c,1)>=1.098);t1:=count(l>=ref(l,a1),a1)>=a1;t2:=count(h<=ref(h,a1),a1)<=(a1-1);t3:=longcross(c,ref(c,a1),a1) and c>=o;xg:t1 and t2 and t3;