if 开仓条件and tsellholdingex('','品种1',0)=0 then begin
tbuyshort(1,shou,lmt,d3,0,'','品种1');
extgbdataset('tt',timetot0(dynainfo(207)));
end
if 开仓条件 and tbuyholdingex('','品种2',0)=0 then begin
tbuy(1,shou,lmt,d4,0,'','品种2');
extgbdataset('tt',timetot0(dynainfo(207)));
end
if timetot0(dynainfo(207))-extgbdata('tt')>=180 and 出场条件 then begin
tsellshort(1,shou,lmt,d1,0,'','品种1');
tsell(1,shou,lmt,d2,0,'','品种2');
end
以上表达的意思是,开仓后如果持仓超过3分钟出场。
现在发现个问题,设置的这个单值取的时间extgbdata('tt')的数值会变化。
举例:如果是10:00已经有成交了,套利成功,extgbdata('tt')取值成功,当持仓时间到一定的数值时,(假设80秒了),突然有会变成持仓时间取值为零(extgbdata('tt')又一次取值),重新开始计算。这个不知道哪里出问题,求助!