我是做5分钟钟线的交易,但用了固定轮询一秒,并且是后台交易,
这样的条件下,在一个5分钟线里如果多次发生触发条件,会多次反应吗,还是要再加allowrepeat?
但实际中加了allowrepeat又疯狂的开单,虽然我都已经加了要tholding2=0才开仓的,而且还加了全局面变量对委托动作进行了限制。
交易部分如下
if 中轨>0 and Z>0 then begin
tsell(sellcond and tholding>0,tholding,mkt),ALLOWREPEAT,ORDERQUEUE;
if islastbar then extgbdataset('isbook',0);
tbuyshort (buyshortcond and tholding2=0 and extgbdata('isbook')=0, 1,mkt),ALLOWREPEAT,ORDERQUEUE;
extgbdataset('isbook',-1);
maxprofit:=0;
tsellshort(sellshortcond and tholding<0,tholding,mkt),ALLOWREPEAT,ORDERQUEUE;
if islastbar then extgbdataset('isbook',0);
tbuy(buycond and tholding2=0 and extgbdata('isbook')=0,1,mkt),ALLOWREPEAT,ORDERQUEUE;
extgbdataset('isbook',1);
maxprofit:=0;
end
tholding2 取到的是真实持仓,你用循环语句快速委托的时候,下出去的单子是不会马上就成交得到回报的,你应该在循环里对委托次数做限制,每次下单通过变量记录自己下了多少,而不是用tholding2去判断。
参考http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=332 问题15
上述的算循环语句啊?
不清楚你的需求,无法帮你改
如果想实现见线平多开空,线突破后再反手平空开多,这样语句上应该怎么处理会好点。