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 - 官方实现
          tts - openctp TTS
          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 环境

支持通道

代码示例

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.0.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

openctp_ctp_channels-0.1.0-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

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