variable:n=0;
if n=0 and holding=整体手数 and (h-enterprice)/enterprice>0.01 then begin
sell(1,这里写1%止赢的手数,market);
n:=1;
end
if n=1 and holding=1%止赢后的手数 and (h-enterprice)/enterprice>0.02 then begin
sell(1,这里写2%止赢的手数,market);
n:=2;
end
if n=2 and holding=前面两个止盈后的手数 and (h-enterprice)/enterprice>0.03 then begin
sell(1,0,market);//3%剩下的就全平拉
n:=0;
end
variable:m=0;
if m=0 and holding=整体手数 and (enterprice-l)/l>0.01 then begin
sellshort(1,这里写1%止赢的手数,market);
m:=1;
end
if m=1 and holding=1%止赢后的手数 and (enterprice-l)/l>0.02 then begin
sellshort(1,这里写2%止赢的手数,market);
m:=2;
end
if m=2 and holding=前面两个止盈后的手数 and (enterprice-l)/l>0.03 then begin
sellshort(1,0,market);//3%剩下的就全平拉
m:=0;
end