委托单tremainqty函数有概率读取不正确 [金字塔]
- 咨询内容:
后台交易,版本3.1正式版代码buyhold:=tbuyholdingex(ac,stklabel,1);sellhold:=tsellholdingex(ac,stklabel,1);wtb:=tremainqty(1,ac,stklabel);wtbp:=tremainqty(2,ac,stklabel);wts:=tremainqty(3,ac,stklabel);wtsp:=tremainqty(4,ac,stklabel);
最小时间间隔不断轮询2014-02-14 09:25:05.862 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.878 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.893 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.909 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.924 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.940 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.956 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.971 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:05.987 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.002 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.018 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.034 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.049 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.065 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.080 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.096 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.112 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.127 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.143 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.158 buyhold=0 sellhold=0 wtb=0 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.174 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.190 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.205 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.221 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.236 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.268 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.283 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.299 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.314 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.330 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.346 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.361 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=926002014-02-14 09:25:06.377 buyhold=0 sellhold=0 wtb=1 wts=0 wtbp=0 wtsp=0 time=92600
问题:在9:24:59下1手多单后,一直到9:25:06.143,多单尚未成交(委托多单——wtb显示1),但9:25:06.158,在多单尚未成交的情况下,读取到的委托多单(WTB)居然变成0了(红色部分),导致我错误的同步下单!据我观察到,在下单后,每一新分钟的第6或第7秒,就会出现读取委托单不正常的情况。麻烦详细检查tremainqty函数
附带交易记录:2014-02-14 09:24:5913900XXX : IF1402 - 已报单 1 价格:2276.8 开 买
2014-02-14 09:25:0613900XXX : IF1402 - 已报单 1 价格:2276.8 开 买
2014-02-14 09:25:4403800XXX : IF1402 - 已报单 3 价格:2276.8 开 买此记录证明在9:24:59~9:25:44期间没有做任何撤单动作,也没有任何单子成交,本人也没做任何手工交易,均为全自动。 - 金字塔客服:
您好,对应在取得未成交单前面加个TACCOUNT( 2)判断下账户是否连接正常
如果账户连接异常取值会存在问题
- 用户回复:
已经在下单前加了If taccount2(2,ac)<>1 then exit;
但其依然在09:25:06根据委托仓位进行仓位调整,说明读取时候账户处于正常状态的~ - 网友回复:
前面加个变量输出TACCOUNT( 2)的值,如果对应为255,说明账户连接异常
buyhold:=tbuyholdingex(ac,stklabel,1); sellhold:=tsellholdingex(ac,stklabel,1); a:TACCOUNT( 2); wtb:=tremainqty(1,ac,stklabel); wtbp:=tremainqty(2,ac,stklabel); wts:=tremainqty(3,ac,stklabel); wtsp:=tremainqty(4,ac,stklabel); 用DEBUGFILE输出A值
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容