tcd:time>=224500 and time<=230000;//平仓不开仓时间段
if tcd then
begin
sell(holding>0,holding,market);
sellshort(holding<0,holding,market);
end
if not(tcd) and 开仓条件 then
begin
//开仓语句
end
这样试下。
1.4点45的平仓用tcd条件
2.开仓条件统一加一个 not(tcd) 来限制开仓的时间段。
老师:美原油不开仓时间是北京时间(5点到6点),其它时间全部是交易的