请教老师,高手;我想在30分钟周期图表程序化上实现提前5秒下单,在网上搜索到阿火的方法;请教这种方法这样可以在实现吗?如何改写?谢谢。
abb:=(mod(currenttime,100)>55 and islastbar) or not(islastbar);
if holding>0 and ma5<ma10 and abb then sell(1,1,thisclose);
if holding<0 and ma5>ma10 and abb then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 and abb then buy(1,1,thisclose);
if holding=0 and ma5<ma10 and abb then buyshort(1,1,thisclose);
第一句要这样写:
abb:=(timetot0(dynainfo(207))>=time0-5 and islastbar) or not(islastbar);
使用固定轮询模式,一秒轮询
请老师解惑;
使用固定一秒轮询的模式,在30分钟操作周期上提前5秒下单。不太理解?如果我使用KDJ交叉作为开平仓信号,在30分钟周期上任意分钟内或者就是在第10分钟出现了交叉信号,会等到29分55秒再发出吗?谢谢。
abb:=(timetot0(dynainfo(207))>=time0-5 and islastbar) or not(islastbar);
if holding>0 and ma5<ma10 and abb then sell(1,1,thisclose);
if holding<0 and ma5>ma10 and abb then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 and abb then buy(1,1,thisclose);
if holding=0 and ma5<ma10 and abb then buyshort(1,1,thisclose);
1.abb这一句要放在最开始,然后添加进下单语句即可
2.一样代码,不用修改
abb:=(timetot0(dynainfo(207))>=time0-5 and islastbar) or not(islastbar);
if holding>0 and ma5<ma10 and abb then sell(1,1,thisclose);
if holding<0 and ma5>ma10 and abb then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 and abb then buy(1,1,thisclose);
if holding=0 and ma5<ma10 and abb then buyshort(1,1,thisclose);