VBA代碼:
————————————————————————
h_result=order.HoldingInfoByCode2(Code, Market, h_BuyHoding, h_BuyCost, h_BuyTodayHoding, h_SellHoding, h_SellCost, h_SellTodayHoding, h_PNL, h_UseMargin,Account)
buyhold= h_BuyHoding
sellhold=h_sellhoding
wtb=0
wts=0
wtbp=0
wtsp=0
ordercount=Order.OrderNum2
For i=0 to ordercount-1
Call Order.OrderInfo2(i,w_OrderID,w_ConSign,w_Filled,w_Remaining,w_Action,w_OrderType,w_LmtPrice,w_Account,w_Kaiping,w_Code,w_Market)
if w_Code=code and w_Account=account then
if w_Kaiping<0.5 then
if w_Action<0.5 then
wtb=wtb+w_Remaining
else
wts=wts+w_Remaining
end if
else
if w_Action<0.5 then
wtsp=wtsp+w_Remaining
else
wtbp=wtbp+w_Remaining
end if
end if
end if
Next
————————————————————————————
情況:
于10:25:00系統自動發了一張數量為2的平空單,此時接收到委托回報后的第1次刷新,可以正常查詢到有委托平空單。
在單子尚未成交或撤單以及賬戶依然在線(可以讀取到持倉單)的情況下,委托單子突然消失了
(金字塔未成交委托的界面單子突然消失,輸出ordercount變量也突然變成0,但快期看到實際委托單子還在)。
版本3.1
情況出現多次了(有概率,大概5%,一般是剛下單或者過幾秒后)
————————————————————————————
輸出變量日志
10:25:00 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
10:25:00 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=2 wt=2 ordercount=1
10:25:00 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
10:25:00 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
10:25:01 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
10:25:01 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
10:25:02 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
10:25:02 buyhold=0 sellhold=3 wtb=0 wts=0 wtbp=0 wtsp=0 wt=0 ordercount=0
————————————————————————————
看看下單日志是怎么記錄的