bar1:barslast(time=0130);
h1:ref(hhv(high,30),bar1);
variable:num1=0;
//夜盘突破前高
if high>h1 and holding<=0 and time>0130 and time<0630 and num1<3 then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
num1:num1+1;
end
//止损3个点
if close<enterprice-3*mindiff then sell(1,holding,marketr);
//盈利大于20后止损放到开仓价
if hhv(close,enterbars) - enterprice>20*mindiff and close<enterprice then sell(1,holding,marketr);
//尾盘平仓
if time = 0630 then
begin
sell(1,holding,marketr);
END
/////////////////////////////////////////////////////////////////////////
bar2:barslast(time=1330);
h2:ref(hhv(high,30),bar2);
variable:num2=0;
//早突破前高
if high>h2 and holding<=0 and time>1330 and time<1530 and num2<3 then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
num2:=num2+1;
end
//止损3个点
if close<enterprice-3*mindiff then sell(1,holding,marketr);
//盈利大于20后止损放到开仓价
if hhv(close,enterbars) - enterprice>20*mindiff and close<enterprice then sell(1,holding,marketr);
//尾盘平仓
if time = 1530 then
begin
sell(1,holding,marketr);
END
time = closetime(1)