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