橡胶为例:
12000多单进场 上涨到12025,止损12000,上涨到12050 止损 12005,上涨到12075 止损 12010 以此类推
橡胶 5元为1个变动单位
variable:hh=0,ll=0;
if 开多条件 and holding=0 then begin
buy(1,1,market);
hh:=h;
end
if holding>0 and h>hh then hh:=h;
if holding>0 then nn:=floor((hh-enterprice)/(5*mindiff));
if l<enterprice+nn*mindiff then sell(1,0,market);
if 开空条件 and holding=0 then begin
buyshort(1,1,market);
ll:=L;
end
if holding<0 and l<ll then ll:=l;
if holding<0 then mm:=floor((enterprice-ll)/(5*mindiff));
if h>enterprice-mm*mindiff then sellshort(1,0,market);