委托單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 進行 有償 編寫!(不貴!點擊查看價格!)
相關文章
-
沒有相關內容