看1分钟K线,商品早上9点开盘到到9点10分之间有个高H.低点L,9:10以后价格突破前10分钟高点即H+1时就买入, 止损价格是L-1.如无触发止损就一直留到下午最后一分钟平仓,但中途触发到涨停板就平仓. 作空相反,
t1:=time>131000 and time<185900;
t2:=time>=185900;
hh:=valuewhen(time=131000,hhv(h,10));
ll:=valuewhen(time=131000,llv(l,10));
if t1 and h>hh then sellshort(1,0,market);
if t1 and h>hh then buy(holding=0,1,market);
if t1 and l<ll then sell(1,0,market);
if t1 and l<ll then buyshort(holding=0,1,market);
if t2 then begin
sell(1,0,market);
sellshort(1,0,market);
end
t1:=time>131000 and time<185900;
t2:=time>=185900;
variable:n=0;
hh:=valuewhen(time=131000,hhv(h,10));
ll:=valuewhen(time=131000,llv(l,10));
if t1 and h>hh then sellshort(1,0,market);
if t1 and h>hh and holding=0 and n=0 then begin
n:=1;
buy(holding=0,1,market);
end
if t1 and l<ll then sell(1,0,market);
if t1 and l<ll and holding=0 and n=0 then begin
n:=1;
buyshort(holding=0,1,market);
end
if t2 then begin
sell(1,0,market);
sellshort(1,0,market);
n:=0;
end