if holding=0 and hazai=1 then begin
buy(1,1,limitr,close);
newprice:=close;
stoplossline:=newprice-stoplossrange;
end
if holding>0 then begin
if(hh>newprice) then begin
newprice:=hh;
end
stoplossline:=newprice-stoplossrange;
if enterbars>=2 and close<stoplossline then begin
sell(1,holding,limitr,close);
stoplossline:=0;
newprice:=0;
end
end
if holding=0 and hazai=-1 then begin
buy(1,1,limitr,close);
newprice:=close;
stoplossline:=newprice-stoplossrange;
end
if holding<0 then
if(ll<newprice) then begin begin
newprice:=ll;
end
stoplossline=newprice+stoplossrange;
if enterbars>=2 and close>stoplossline then begin
buyshort(1,holding,limitr,close);
stoplossline:=0;
newprice:=0;
end
end
可以