打印本文打印本文 关闭窗口关闭窗口

还是关于自动连接的问题

作者:金字塔 来源: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,帖子转至高级功能研发区。等待相关人员处理,谢谢
打印本文打印本文 关闭窗口关闭窗口