不要加or Texitbars=-1,
在开仓条件里加上 Texitbars>0
if 止损条件 then begin
tsellshort.......;
extgbdataset('biaoji',0);
end
if 止盈条件 then begin
tsellshort..;
extgbdataset('biaoji',0);
end
if 开空条件 and extgbdata('biaoji')=1 then tbuyshort..;
类似于这样的办法,用全局变量来记录,全局变量=0时表示止盈止损过了所以不开仓,全局变量=1的时候进行开空。等到需要再次开空的时候,再把全局变量赋值为1