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柜台 ctp-cp - 上期技术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
支持通道
- 上期技术CTP柜台评测版(ctp-cp)
| version | win x86 | win x64 | linux x64 |
|---|---|---|---|
| 6.3.19 | ✔️ | ✔️ | ✔️ |
| 6.5.1 | ✔️ | ✔️ | ✔️ |
| 6.6.1 | ✔️ | ✔️ | ✔️ |
| 6.6.7 | ✔️ | ✔️ | ✔️ |
| 6.6.9 | ✔️ | ✔️ | ✔️ |
| 6.7.0 | ✔️ | ✔️ | ✔️ |
| 6.7.2 | ✔️ | ✔️ | ✔️ |
| 6.7.7 | ✔️ | ✔️ | ✔️ |
| 6.7.8 | ✔️ | ✔️ | ✔️ |
| 6.7.10 | ✔️ | ✔️ | ✔️ |
-
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 ✔️ ✔️ ✔️ 6.3.19 ✔️ ✔️ ✔️ 6.5.1 ✔️ ✔️ ✔️ 6.6.1 ✔️ ✔️ ✔️ 6.6.7 ✔️ ✔️ ✔️ 6.6.9 ✔️ ✔️ ✔️ 6.7.0 ✔️ ✔️ ✔️ 6.7.1 ✔️ ✔️ ✔️ 6.7.2 ✔️ ✔️ ✔️ 6.7.7 ✔️ ✔️ ✔️ 6.7.8 ✔️ ✔️ ✔️ 6.7.9 ✔️ ✔️ ✔️ 6.7.10 ✔️ ✔️ ✔️ -
华鑫证券奇点股票(tora)
version win x86 win x64 linux x64 6.3.15 ✔️ ✔️ ✔️ 6.3.19 ✔️ ✔️ ✔️ 6.5.1 ✔️ ✔️ ✔️ 6.6.1 ✔️ ✔️ ✔️ 6.6.7 ✔️ ✔️ ✔️ 6.6.9 ✔️ ✔️ ✔️ -
东方财富EMT(emt)
version win x64 linux x64 6.3.15 ✔️ ❌ 6.3.19 ✔️ ❌ 6.5.1 ✔️ ❌ 6.6.1 ✔️ ❌ 6.6.7 ✔️ ❌ -
中泰证券XTP(xtp)
version win x86 win x64 linux x64 6.6.1 ❌ ✔️ ❌ -
新浪财经(sina)
只能查询行情,不可以交易,详情跳转version win x86 win x64 linux x64 6.3.15 ✔️ ✔️ ✔️ 6.3.19 ✔️ ✔️ ✔️ 6.5.1 ✔️ ✔️ ✔️ 6.6.1 ✔️ ✔️ ✔️ 6.6.7 ✔️ ✔️ ✔️ 6.6.9 ✔️ ✔️ ✔️ 6.7.0 ✔️ ✔️ ✔️ 6.7.1 ✔️ ✔️ ✔️ 6.7.2 ✔️ ✔️ ✔️ 6.7.7 ✔️ ✔️ ✔️ -
腾讯财经(qq)
只能查询行情,不可以交易,详情跳转version win x86 win x64 linux x64 6.3.15 ✔️ ✔️ ✔️ 6.3.19 ✔️ ✔️ ✔️ 6.5.1 ✔️ ✔️ ✔️ 6.6.1 ✔️ ✔️ ✔️ 6.6.7 ✔️ ✔️ ✔️ 6.6.9 ✔️ ✔️ ✔️ 6.7.0 ✔️ ✔️ ✔️ 6.7.1 ✔️ ✔️ ✔️ 6.7.2 ✔️ ✔️ ✔️ 6.7.7 ✔️ ✔️ ✔️ -
易盛
-
易达
-
量投QDP
代码示例
todo...
注意
- openctp-ctp 在被使用中时,无法切换通道
- 如果开启了网络代理,切换通道可能失败,关闭代理重试
Release files for openctp-ctp-channels 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openctp_ctp_channels-0.2.0.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openctp_ctp_channels-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.1 kB
Release files / openctp_ctp_channels-0.2.0.tar.gz
| Download URL | openctp_ctp_channels-0.2.0.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd733b5f364dd678e7018b3c214a14f775591cb9f1057762a1dc9f6e744624ef
|
|
BLAKE2b-256 checksum How to use checksums |
6727318d22da5ec62486921449a03d823fdf6cb569d7105f0c9da4af2665bf16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / openctp_ctp_channels-0.2.0-py3-none-any.whl
| Download URL | openctp_ctp_channels-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4b21e6e7dcdf190d719f84c4390e5cb0ac05216090ae63430d9a6cc40109723
|
|
BLAKE2b-256 checksum How to use checksums |
e521b4e06e2a7689ce757cfcccfdcfb081d60ad2da54ccd015680ff00c9ad2a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|