Skip to main content

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

enkeep_ctp-6.7.7.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

enkeep_ctp-6.7.7.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

enkeep_ctp-6.7.7.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

enkeep_ctp-6.7.7.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (7.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

File details

Details for the file enkeep_ctp-6.7.7.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 df062d2a7d83d10ad6c3b2e7dadeebf0966163b6330541e0dc6e5ddc82ccf506
MD5 e4f2491994e986a645d67d294e4f4303
BLAKE2b-256 21fbbab4d6793b4948d27177bef0edbcd643e3c0178783cbafa01d458c7d6b26

See more details on using hashes here.

File details

Details for the file enkeep_ctp-6.7.7.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c090653c14c769485a21e6d365eaee62a854357793ac21627312ed3bd6671b3e
MD5 e4b871790e1b7ee367d8e7c546606949
BLAKE2b-256 a4994f2c29819ed1998163619a47c1cf5b49d3fdb9e272e164948fce30fdec21

See more details on using hashes here.

File details

Details for the file enkeep_ctp-6.7.7.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 15d6828995452a0e82e83c279f863d916f3e51de39d71b57ac6b3f3a3c4050b1
MD5 e1c6e99618c4a7d0c7c6470e75b6d915
BLAKE2b-256 495f8ace5220fa3d2a31748167f7650996acfe4d55dee5224ea7acc51c8b2fa8

See more details on using hashes here.

File details

Details for the file enkeep_ctp-6.7.7.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2963f9a215c99913f206141ac1a7014570d00b623cb049aad80844d713f37a69
MD5 f959d2f23ef837253321f5aa498b189d
BLAKE2b-256 80b92701ed1a300ba857a95fea0d5f4c516276d8813e645e3519485a4d8d23a4

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