请教:如何在下面这个日内交易模型(五分钟周期)加上提前5秒下单 。
T1:=TIME>090000 AND TIME <145000;
pkkd:=cross(c,ma(c,5)) and t1;
pdkk:=cross(ma(c,5),c) and t1;
if pkkd then
begin
sellshort(holding < 0, 1, limitr,open);
buy(holding = 0, 1, limitr,c+5*mindiff);
end
if pdkk then
begin
sell(holding > 0, 1, limitr,open);
buyshort(holding = 0, 1, limitr,c-5*mindiff);
end
T1:=TIME>090000 AND TIME <145000;
nn:=timetot0(time)-timetot0(dynainfo(207));
pkkd:=cross(c,ma(c,5)) and t1;
pdkk:=cross(ma(c,5),c) and t1;
if pkkd and nn<=5 and islastbar or (pkkd and not(islastbar)) then
begin
sellshort(holding < 0, 1, limitr,open);
buy(holding = 0, 1, limitr,c+5*mindiff);
end
if pdkk and nn<=5 and islastbar or (pdkk and not(islastbar)) then
begin
sell(holding > 0, 1, limitr,open);
buyshort(holding = 0, 1, limitr,c-5*mindiff);
end
timetot0(time): 括号中的时间距离当日0点的秒数。
括号中的time是k线时间,例如5分钟周期第一根k线的time是090500 转换成秒,返回结果是32700秒。