CTP gateway for enkeep_trade quant trading framework.
Project description
enkeep框架的CTP底层接口
说明
基于CTP期货版的6.7.7接口封装开发,接口中自带的是【穿透式实盘环境】的dll文件。
tips:
打包
windows:
pip install build
python -m build .
linux: 使用 cibuildwheel 自动化构建 如果你希望自动化整个流程,可以使用 cibuildwheel,它支持多平台自动构建和打包。
pip install cibuildwheel
cibuildwheel --output-dir dist
发布
先安装一下 twine:
python -m pip install twine
twine upload dist/*
# 推送到 coding-pypi
twine upload -r coding-pypi dist/*
没有账户去注册一个 https://pypi.org/
使用
以脚本方式启动(script/run.py):
from enkeep_trade.event import EventEngine
from enkeep_trade.trader.engine import MainEngine
from enkeep_trade.trader.ui import MainWindow, create_qapp
from enkeep_ctp import CtpGateway
def main():
"""主入口函数"""
qapp = create_qapp()
event_engine = EventEngine()
main_engine = MainEngine(event_engine)
main_engine.add_gateway(CtpGateway)
main_window = MainWindow(main_engine, event_engine)
main_window.showMaximized()
qapp.exec()
if __name__ == "__main__":
main()
Mac系统支持
由于新版本CTP的Mac系统API项目结构发生了较大变化,改为了使用framework目录的结构,因此无法再直接从PyPI下载预编译好的wheel二进制包进行安装。
用户需要克隆(或下载)本仓库的源代码到本地后自行编译安装,具体命令如下:
git clone https://github.com/vnpy/enkeep_ctp.git
cd enkeep_ctp
pip3 install .
相关注意事项如下:
源码编译需要依赖XCode开发工具中的C++编译器,请务必先安装好。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enkeep_ctp-6.7.7.6.tar.gz.
File metadata
- Download URL: enkeep_ctp-6.7.7.6.tar.gz
- Upload date:
- Size: 12.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef5ec01b506679a7165f2c1f690c9d7fc05e3567e727a2892031e77ba2448b80
|
|
| MD5 |
dc279bf5e17c6eacf225d25574a05b54
|
|
| BLAKE2b-256 |
10b7d172bfdd5de9658a0b1e3694c967dffa3019c9e3fcf28ab70cf828f58907
|
File details
Details for the file enkeep_ctp-6.7.7.6-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: enkeep_ctp-6.7.7.6-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a76f623a2b66b3255c72e487ac1a62ba13b3edb5fb2b61c3cb4e32992271f2d4
|
|
| MD5 |
bb4d6a35de82ca21878d72f16cb1fee9
|
|
| BLAKE2b-256 |
07fd505c8af690ae57d3593f59bc3c8d351724470fd42429094745b05ab5299f
|
File details
Details for the file enkeep_ctp-6.7.7.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: enkeep_ctp-6.7.7.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 7.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e4ba08c38a14e7c8fd86e80c60fca3a9f2b3615ff4cf9a3b515121c8d22097f
|
|
| MD5 |
cc7b5808e250dc3aeb5214b71315cb0c
|
|
| BLAKE2b-256 |
e6e9bae69de2e098a5a5354c765d0826cf215cddd9242f550d9ff237cb047fd1
|