rsvk:=(close-llv(low,9))/(hhv(high,9)-llv(low,9))*100;
k:=sma(rsvk,3,1);
d:=sma(k,3,1);
j:=3*k-2*d;
ma3:=ma(c,3);
买入1:=cross(c,ma3)and ma3>=ref(ma3,1)*0.99;{日收盘价上穿ma3}
买入2:=c>ma3 and(c-ma3)/ma3<0.035and ma3>ref(ma3,1)*0.998;{收盘价在ma3上方不远}
买入3:=c>ma3 and ref(ma3,1)<ref(ma3,2)and ref(ma3,2)<ref(ma3,3);{ma3刚刚向上}
买入4:=c>ma3 and j<80 and cross(j,d);{kdj的j值在低位,或者j线已经向上行,或者j与d即将或刚刚发生金叉}
不买入1:=j>80or count(cross(d,j),2)>0;{kdj的j值在高位,或者j线高位并向下行,或者j与d即将或已经发生死叉}
不买入2:=(c-ma3)/ma3>=0.035;{收盘价高于ma3太远}
不买入3:=0>c*1.02;{长阴线不买}
不买入4:="cci">100;{日cci向上过100}
不买入5:=ref(c,1)>ref(ma3,1)and ref(c,2)>ref(ma3,2);{股价两天站在ma3之上}
不买入6:=count(ma3>ref(ma3,1)*1.0015,4)>=3;{ma3向上多日}
判断买入:=not(不买入1 or 不买入2 or 不买入3 or 不买入4 or 不买入5 or 不买入6) and (买入1 or 买入2 or 买入3 or 买入4);
买入条件:=filter(判断买入,1);
x1:=count(ref(买入条件,1),3=0 or cross(j,d));
x2:=count(ref(买入条件,1),1)=0;
买入x1 and x2 and 买入条件); |