不知道对否 ,可参考一下我写的
if not(time>=093500) then exit;
exittime:=time>=025800;
n:=barslast(date<>ref(date,1));
dayhigh:=ref(hhv(h,n),1);
daylow:=ref(llv(l,n),1);
h30:=ref(hhv(h,30),1);
l30:=ref(llv(l,30),1);
if time>093500 and h>=h30 then buy(holding=0,1,market);
if time>093500 and l<=l30 then buyshort(holding=0,1,market);
if holding>0 then begin
if enterprice>dayhigh and close<=l30 or enterprice<daylow then sell(1,holding,market);
if enterprice<daylow then buyshort(1,1,market);
end;
if holding<0 then begin
if enterprice<daylow and close>=h30 or enterprice>dayhigh then sellshort(1,holding,market);
if enterprice<dayhigh then buy(1,1,market);
end
if time>=145800 and time<=150000 then begin
sellshort(holding<0,0,close);
sell(holding>0,0,close);
end
[此贴子已经被作者于2011-11-7 10:05:32编辑过]