VeighNa量化社区
你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 31
声望: 0

连接simnow,日志提示:交易服务器连接断开,原因4097
后台报错如下,请问如何解决:
js: Mixed Content: The page at 'https://www.vnpy.com/forum/topic/6658-mei-you-simnow-jiu-yong-uftgatewaydui-jie-heng-sheng-yun-jin-rong-jiao-yi-ce-shi-ping-tai' was loaded over HTTPS, but requested an insecure image 'http://thirdwx.qlogo.cn/mmopen/vi_32/ejQSRYvn5ibO9QfjibVarAPB68NLB14gBPugdmqOZwiadG37z5LD8ibcce2myUiajZzbAL4NZQ5h5Zf5WN5QKdlJDEw/132'. This content should also be served over HTTPS.
js: Mixed Content: The page at 'https://www.vnpy.com/forum/topic/6658-mei-you-simnow-jiu-yong-uftgatewaydui-jie-heng-sheng-yun-jin-rong-jiao-yi-ce-shi-ping-tai' was loaded over HTTPS, but requested an insecure image 'http://thirdwx.qlogo.cn/mmopen/vi_32/KnxusZJQOsQQVBpDTatXlzWLtp2AXn1ys5IcOf7P5bBMu55sNusUMeqba1gHfFIotHnnxGED57FLozoY0OoA7A/132'. This content should also be served over HTTPS.
qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
CThostFtdcUserApiImplBase::OnSessionDisconnected[000001CB778F0238][-1979580414][ 4097]

Member
avatar
加入于:
帖子: 337
声望: 27

请排查下列问题:

  1. simnow必须使用CTP端口
  2. 请不要连接多个C++接口
  3. 请确认交易和行情地址填写正确,SimNow必须使用第一套2、3组,或者第二套环境
  4. simnow账号注册后要在官网修改一次密码
Member
avatar
加入于:
帖子: 31
声望: 0

上面4个问题排查以后,使用第一套的第二组服务器,simnow官网的快期能正常登录,python程序报错如下:

Decrypt handshake data failed
CThostFtdcUserApiImplBase::OnSessionDisconnected[00000244855591D8][1961099265][ 4097]

我的代码如下:

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
# from vnpy.gateway.ctp import CtpGateway
from vnpy.gateway.ctptest import CtptestGateway
from vnpy.app.cta_strategy import CtaStrategyApp
from vnpy.app.cta_backtester import CtaBacktesterApp


def main():
    """Start VN Trader"""
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)

    # main_engine.add_gateway(CtpGateway)
    main_engine.add_gateway(CtptestGateway)
    main_engine.add_app(CtaStrategyApp)
    main_engine.add_app(CtaBacktesterApp)

    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()


if __name__ == "__main__":
    main()
Member
avatar
加入于:
帖子: 31
声望: 0

使用CtpGateway后,使用第一套的第二组服务器,错误如图
description

代码如下:

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy.gateway.ctp import CtpGateway
# from vnpy.gateway.ctptest import CtptestGateway
from vnpy.app.cta_strategy import CtaStrategyApp
from vnpy.app.cta_backtester import CtaBacktesterApp


def main():
    """Start VN Trader"""
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)

    main_engine.add_gateway(CtpGateway)
    # main_engine.add_gateway(CtptestGateway)
    main_engine.add_app(CtaStrategyApp)
    main_engine.add_app(CtaBacktesterApp)

    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()


if __name__ == "__main__":
    main()
Member
avatar
加入于:
帖子: 337
声望: 27

jaried wrote:

使用CtpGateway后,使用第一套的第二组服务器,错误如图
description

代码如下:

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy.gateway.ctp import CtpGateway
# from vnpy.gateway.ctptest import CtptestGateway
from vnpy.app.cta_strategy import CtaStrategyApp
from vnpy.app.cta_backtester import CtaBacktesterApp


def main():
    """Start VN Trader"""
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)

    main_engine.add_gateway(CtpGateway)
    # main_engine.add_gateway(CtptestGateway)
    main_engine.add_app(CtaStrategyApp)
    main_engine.add_app(CtaBacktesterApp)

    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()


if __name__ == "__main__":
    main()

这个报错是因为穿透式认证的产品名称和授权码错误,请联系期货公司确认吧

Member
avatar
加入于:
帖子: 31
声望: 0

这个报错是因为穿透式认证的产品名称和授权码错误,请联系期货公司确认吧

经纪商代码改为9999后,使用ctp能正常登录,谢谢

© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】