//开头条件
long:=h>H2 and time>093000 and time<150500;
if long then
begin
sellshort(holding<0,0,mkt);
buy(holding=0,1,mkt);
end
long2:=l<l1 and l>L2 and x=0 and time>093000 and time<150500;
if long2 then
begin
sellshort(holding<0,0,mkt);
buy(holding=0,1,mkt);
end
//开空条件
short:=l<l2 and time>093000 and time<150500;
if short then
begin
sell(holding>0,0,mkt);
buyshort(holding=0,1,mkt);
end
short2:=h>h1 and h<H2 and x=0 and time>093000 and time<150500;
if short2 then
begin
sell(holding>0,0,mkt);
buyshort(holding=0,1,mkt);
end
//收盘前平仓
if time>151000 then
begin
x:=0;
sell(holding>0,0,thisclose);
sellshort(holding<0,0,thisclose);
end