Skip to main content

Multi channels support for openctp-ctp

Project description

openctp-ctp-channels


openctp 提供了兼容各大柜台的统一 CTPAPI 兼容接口库,openctp-ctp 也继承了这个能力。

openctp-ctp-channels 简化了替换兼容接口库的过程,可以快速上手体验,连接不同的柜台环境。

快速使用

  • 安装

    pip install openctp-ctp-channels -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host=pypi.tuna.tsinghua.edu.cn
    
  • 展示所有通道

    $ openctp-channels show
    Support channels:
          ctp - 上期技术CTP柜台
          tts - openctp TTS柜台 7x24环境
          tts-s - openctp TTS柜台 仿真环境(接实盘行情)
          emt - 东方财富EMT柜台
          xtp - 中泰证券XTP柜台
          tora - 华鑫证券奇点股票柜台
          qq - 腾讯财经(只有行情)
          sina - 新浪财经(只有行情)
    
  • 展示当前通道

    $ openctp-channels check
    Current channel: ctp
    
  • 切换通道

    $ openctp-channels switch tts
    Switch to tts channel.
    
    $ openctp-channels check
    Current channel: tts
    

    切换通道 tts 成功后,即可使用 openctp-ctp 库连接TTS 7x24环境

更多示例参见 ctp.examples

支持通道

  • openctp TTS(tts/tts-s)

    详情跳转

    TTS仿真环境没有提供行情服务,需要连接实盘行情(连接实盘行情不需要替换dll/so), 因此多了一个 tts-s 通道

    tts 通道用于连接 TTS 7x24 环境; tts-s 通道用于连接 TTS 仿真环境

    version win x86 win x64 linux x64
    6.3.15 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.3.19 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.5.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.9 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.0 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.2 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.8 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.9 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.10 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
  • 华鑫证券奇点股票(tora)

    详情跳转

    version win x86 win x64 linux x64
    6.3.15 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.3.19 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.5.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.9 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
  • 东方财富EMT(emt)

    详情跳转

    version win x64 linux x64
    6.3.15 :heavy_check_mark: :x:
    6.3.19 :heavy_check_mark: :x:
    6.5.1 :heavy_check_mark: :x:
    6.6.1 :heavy_check_mark: :x:
    6.6.7 :heavy_check_mark: :x:
  • 中泰证券XTP(xtp)

    详情跳转

    version win x86 win x64 linux x64
    6.6.1 :x: :heavy_check_mark: :x:
  • 新浪财经(sina)
    只能查询行情,不可以交易,详情跳转

    version win x86 win x64 linux x64
    6.3.15 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.3.19 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.5.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.9 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.0 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.2 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
  • 腾讯财经(qq)
    只能查询行情,不可以交易,详情跳转

    version win x86 win x64 linux x64
    6.3.15 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.3.19 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.5.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.6.9 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.0 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.1 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.2 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
    6.7.7 :heavy_check_mark: :heavy_check_mark: :heavy_check_mark:
  • 易盛

  • 易达

  • 量投QDP

代码示例

todo...

注意

  • openctp-ctp 在被使用中时,无法切换通道
  • 如果开启了网络代理,切换通道可能失败,关闭代理重试

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openctp_ctp_channels-0.1.9.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openctp_ctp_channels-0.1.9-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file openctp_ctp_channels-0.1.9.tar.gz.

File metadata

  • Download URL: openctp_ctp_channels-0.1.9.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for openctp_ctp_channels-0.1.9.tar.gz
Algorithm Hash digest
SHA256 ee3cfb3cd2310cc0fd06a44a6ec47874a9da55887750c4e4f01dd3601a610258
MD5 bdf451426eed884c568ae3feef126826
BLAKE2b-256 aa8db2044ed9db442c2e926cc7b1ac8588357146ddfa3ce29d0db18d09808a49

See more details on using hashes here.

File details

Details for the file openctp_ctp_channels-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for openctp_ctp_channels-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 49a64076e3a0faf96a8bb4ba017f94b9a5fe9ed08905360088885afa797a97ed
MD5 a0a94c35529058a0d4df9729f6f9f355
BLAKE2b-256 e6186d6d139920278ffe777704d9f114312ca7de087955734eb5c5f97da71f73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page