一,“K线走完模式”转换成“固定轮询模式”或者“混合模式”的方法
那么,如果是 K线走完模式和盘中模式并存,怎么做呢?也简单,就是在“开盘价下单语句”后面加入蓝色部分的“盘中下单语句”就行了
如下:
runmode:0;
variable:zs=0,cc=0;
ma5:=ma(c,5);
ma20:=ma(c,20);
entertime:=time>100000 and time<144500;
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 l<zs then begin
sell(1,1,limitr,min(o,zs-0.6));
cc:=0;
end
if cc<0 and h>zs then begin
sellshort(1,1,limitr,max(o,zs+0.6));
cc:=0;
end
if cc>0 and ma5<ma20 then cc:=0;
if cc<0 and ma5>ma20 then cc:=0;
if cc=0 and ma5>ma20 and entertime then begin
cc:=1;
zs:=c-10;
end
if cc=0 and ma5<ma20 and entertime then begin
cc:=-1;
zs:=c+10;
end
if time>=150000 then begin
cc:=0;
end
请教一下阿火,现在这种模式是出了信号之后下一根k线的开盘价下单,但是由于有些品种(例如股指)价格波动大,如果下一根k线开盘价开仓的话,滑点会很大,所以我想问下,有办法当根k线走完立刻下单吗?就是当本根k线一走完就立刻下单,或者是本根k线的最后一秒下单。
30秒周期也是一样的