VARIABLE:n=0,m=0;
oo:VALUEWHEN(todaybar=1,o);
cc:VALUEWHEN(todaybar=1,ref(c,1));
if date<>ref(date,1) then begin
n:=0,
m:=0;
end
if time>=090500 and oo>cc and n=0 then begin
buy(holding=0,1,market);
n:=1;
end
if time>090500 and oo<cc and m=0 then begin
buyshort(holding=0,1,market);
m:=1;
end
//跟踪止损30个最小变动价
ll:llv(l,enterbars+1);
hh:hhv(h,enterbars+1);
if h-ll>=30*mindiff then sell(holding>0,holding,market);
if hh-l>=30*mindiff then sellshort(holding<0,holding,market);
//高开幅度比例大于3%开仓
if time>90500 and n=0 and (cc-oo)/oo>=0.3 then begin
buy(holding=0,1,market);
n:=1;
end
if time>090500 and m=0 and (oo-cc)/oo>=0.3 then begin
buyshort(holding=0,1,market);
m:=1;
end
//开盘价的1%跟踪止损
if h-ll>=0.01*oo then sell(holding>0,holding,market);
if hh-l>=0.01*oo then sellshort(holding<0,holding,market);
//收盘前5分钟平仓
if time>=145500 then begin
sell(holding>0,holding,market);
sellshort(holding<0,holding,market);
end