VARIABLE:n=0;
b:=1;
x:=4600;//改入场点的话只需改x的值
if h=x and n=0 then begin //入场点价格x
buy(holding=0,b,market);
n:=1;
end
if l<=x-0.005*x and n=1 then begin
sell(holding>0,holding,market);
buyshort(holding=0,b,market);
n:=2;
end
if n=2 and c=4600 then begin
sellshort(holding<0,holding,market);
buy(holding=0,2*b,market);
n:=3;
end
if l<=x-0.005*x and n=3 then begin
sell(holding>0,holding,market);
buyshort(holding=0,4*b,market);
n:=4;
end
if n=4 and c=x then begin
sellshort(holding<0,holding,market);
buy(holding=0,8*b,market);
n:=5;
end
if n=5 and l<=x-0.005*x then begin
sell(holding>0,holding,market);
n:=0;
end