if c>enterprice*(1+x) and holding>0 then sell(1,0,marketr);//多头止盈
if c<enterpric *(1-x1) and holding<0 then sell(1,0,marketr);//止损多头
if c<enterprice*(1+x) and holding<0 then sellshort(1,0,marketr);///空头止盈
if c>enterprice*(1-x1) and holding>0 then sellshort(1,0,marketr);//止损空头
能不能在止盈止损后,再不交易,直到收盘平仓?
variable:bj=0;
if c>enterprice*(1+x) and holding>0 then begin
bj:=1;
sell(1,0,marketr);//多头止盈
end
if c<enterpric *(1-x1) and holding<0 then begin
bj:=1;
sell(1,0,marketr);//止损多头
end
if c<enterprice*(1+x) and holding<0 then begin
bj:=1;
sellshort(1,0,marketr);///空头止盈
end
if c>enterprice*(1-x1) and holding>0 then begin
bj:=1;
sellshort(1,0,marketr);//止损空头
end
if time=closetime(0) then bj:=0;