勾选走完一根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