股指期货:
1.突破后回调到5日均线上方0.2点时买入
r1:=ma(c,5);
if cross(c,r1) then k1:=1;
if cross(r1,c) then k1:=-1;
r2:=barslast(c<r1);
r3:=ref(r1,1)
if k1>0 and r2>3 and l-ref(r1,1)<=0.2 then buy(holding=0,1,limitr,r3+0.2);
2.收盘价回调到5日均线的下方买入
r1:=ma(c,5);
if cross(c,r1) then k1:=1;
if cross(r1,c) then k1:=-1;
r2:=barslast(c>r1);
if k1<0 and r2=1 then buy(holding=0,1,limitr,c);
ma5:=(callstock(stklabel,vtopen,6,0)+callstock(stklabel,vtopen,6,-1)+callstock(stklabel,vtopen,6,-2)
+callstock(stklabel,vtopen,6,-3)+callstock(stklabel,vtopen,6,-4))/5;
if holding=0 then begin
buy(L<ma5,1,market);
end
if holding=0 then begin
buyshort(H>ma5,1,market);
end
if enterbars>openminutes(time) then begin
sell(holding>0,holding,market);
sellshort(holding<0,holding,market);
end
回踩5天线开仓,第二天开盘平仓。