A条件开仓的单至交易所收盘前5分钟平仓(包括日盘和夜盘)。怎么写,多谢。
t1:=time>opentime(1) and time0<=timetot0(closetime(1))-5*60;
t2:=time>opentime(2) and time0<= timetot0(closetime(0))-5*60;
开仓条件加入 (t1 or t2)
//开仓
t1:=time>opentime(1) and time0<=timetot0(closetime(1))-5*60;
t2:=time>opentime(2) and time0<= timetot0(closetime(0))-5*60;
if 跳升 and (t1 or t2) and holding=0 then begin
buy(holding=0,50%,market),pertrader;
end
===========开仓后就平仓了。哪不对呢?
[此贴子已经被作者于2016-8-18 11:31:24编辑过]
开仓后立即平仓说明你的平仓条件是很容易满足的
[此贴子已经被作者于2016-8-18 11:32:22编辑过]
平仓条件就是收盘前5分钟。按你上面的没到收盘前5分钟就平仓。
[此贴子已经被作者于2016-8-18 12:24:35编辑过]
if (time0=timetot0(closetime(1))-5*60) or (time0=timetot0(closetime(0))-5*60) then begin
sell(1,0,market);
sellshort(1,0,market);
end