if T0TOTIME(TIMETOT0(CLOSETIME(0))-180)<=DYNAINFO(207) or (time=190000 and not(ISLASTBAR)) then begin
sell(1,holding,MARKET);
end
如果运行的周期是1分钟或者3分钟直接用下面的代码。
if 开仓条件=1 and time>093000 AND TIME<143000 THEN BEGIN
BUY(....);
END
IF holding<>0 and time=145700 then begin
sell(....);
end
否者如果是其他周期,请采用固定时间间隔方式运行策略。 注:最后一根k的时间包含14:57分。
if 开仓条件=1 and time>093000 AND TIME<143000 THEN BEGIN
BUY(....);
END
if T0TOTIME(TIMETOT0(CLOSETIME(0))-180)<=DYNAINFO(207) or (time=150000 and not(ISLASTBAR)) then begin
sell(1,holding,MARKET);
end