如何做到信号出现,立刻执行,而不是
SELl(X=0,0,THISCLOSE);
SELl(X=0,0,MARKET);
信号出现,立刻执行.
启动程序化交易的对话框里,"程序化交易运行模式",---选用"固定时间间隔"
注意代码的编写,在一根K线内不能出现信号闪烁
以此策略为例,就不会有信号闪烁
buycond:=ref(count(c>o,2)=2,1);
sellcond:=ref(count(c<o,2)=2,1);
//平空
if holding<0 and buycond then sellshort(1,1,marketr);
//开多
if buycond and holding=0 then
begin
buy(1,1,marketr);
end
//平多
if holding>0 and sellcond then sell(1,1,marketr);
//开空
if holding=0 and sellcond then buyshort(1,1,marketr);
这样写跟走完K线有什么区别
出信号立即出现是不体现在代码里面,需要在图表交易界面设定为1秒固定时间间隔
上面的回答不要看代码,代码没有什么好研究的,要看中文论述部分