還是關于自動連接的問題
作者:金字塔 來源:cxh99.com 發布時間:2014年09月03日
- 咨詢內容:
這是我早上VBA自動連接后的截圖
此主題相關圖片如下:捕獲.jpg
在交易時段,我通過 VBA每一分鐘自動判斷當前是否連接。從截圖可以看到,通過VBA連接后,股票行情處于“連接中”狀態,但VBA函數去判斷連接狀態時,對于“連接中”的狀態也是返回1,即默認已連接,但事實上并沒有連接成功。
- 金字塔客服:
檢測部分的VBA代碼貼下
- 用戶回復:
if ttt>cdate("08:56:00") and ttt<cdate("15:15:00") and application.ReceiveDatastatus=0 then call application.ReceiveData(1) application.MsgOut "已連接! "&date()&" "&time() end if if ttt>cdate("15:15:00") and application.ReceiveDatastatus then call application.ReceiveData(0) application.MsgOut "斷開連接! "&date()&" "&time() end if
這個是每天開盤前自動連接,收盤后自動斷開!
- 網友回復:
if oautoit.winexists("金字塔") then call oautoit.WinClose("金字塔") 'call oautoit.sleep(1000) application.MsgOut "斷線了!"&date()&" "&time() call application.ReceiveData(0) end ifif ttt>cdate("08:56:00") and ttt<cdate("15:15:00") and application.ReceiveDatastatus=0 then call application.ReceiveData(1) application.MsgOut "已連接! "&date()&" "&time() end if if ttt>cdate("15:15:00") and application.ReceiveDatastatus then call application.ReceiveData(0) application.MsgOut "斷開連接! "&date()&" "&time() end if
這段是VBA中的代碼,通過每分鐘中斷一次來調用。當出現斷線時,會彈出“金字塔”的斷線窗口,通過判斷是否存在該窗口,來判斷是否斷線 !下面是 每天開盤前自動連接,收盤后自動斷開!
- 網友回復:
1,帖子轉至高級功能研發區。等待相關人員處理,謝謝