勾选走完一根K线 是没办法的
把K线走完下单改成下一根开盘下单,把最后一根K线图的信号保持原样(但限定时间)
完整示例如下:
variable:cc=0;
if holding>0 and cc<=0 then sell(1,1,limitr,o);
if holding<0 and cc>=0 then sellshort(1,1,limitr,o);
if holding=0 and cc>0 then buy(1,1,limitr,o);
if holding=0 and cc<0 then buyshort(1,1,limitr,o);
if cc>0 and c<o then begin
sell(time=closetime(0) and dynainfo(207)>=145950,1,limitr,c);
cc:=0;
end
if cc<0 and c>o then begin
sellshort(time=closetime(0) and dynainfo(207)>=145950,1,limitr,c);
cc:=0;
end
if cc=0 and c>o then begin
buy(time=closetime(0) and dynainfo(207)>=145950,1,limitr,c);
cc:=1;
end
if cc=0 and c<o then begin
buyshort(time=closetime(0) and dynainfo(207)>=145950,1,limitr,c);
cc:=-1;
end
请求火哥帮助写出5分钟周期的策略,后台程序交易中在15:00能提前30秒下单的模板。例如,下单交易指令为非多即空,谢谢啦。
2楼写的就是应用于各个分钟周期的.
如果要收盘前提前30秒下单,只用在对应类型dynainfo(207)>=145950这些的地方(示例是提前10秒)
改后面的时间为145930就是提前30秒(150000收盘)