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 Distribution

enkeep_ctp-6.7.7.11.tar.gz (12.5 MB view details)

Uploaded Source

Built Distributions

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

enkeep_ctp-6.7.7.11-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.11-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.11-cp311-cp311-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.11Windows x86-64

enkeep_ctp-6.7.7.11-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.11-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.11.tar.gz.

File metadata

  • Download URL: enkeep_ctp-6.7.7.11.tar.gz
  • Upload date:
  • Size: 12.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for enkeep_ctp-6.7.7.11.tar.gz
Algorithm Hash digest
SHA256 29a1a053e911aa7aa0a555a2738579e9c9f078c6c72f9b4c6cf44f6196bd4b12
MD5 a09311dcea0faac7884bc15c01867b84
BLAKE2b-256 0c59dac68b1ec79e3f9ea2e23f08fb488a93655786f9d0d7b32f650e6443d1dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 64fbcb84749bb89a62296a6ce8813dd217b755ef09237e715fb75479aa5df6c4
MD5 075dec3818d9f0844726457ae2cf306f
BLAKE2b-256 cef1e3a708929a694b988d018ece337eed002031da907b371355944621691c15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 47d6482d8848c92d77ab2182b7d69349a73f160776ed76fb294865ea498635ba
MD5 003872b927d948b36a8195c63f0af2de
BLAKE2b-256 cebe18ee9e0772cb3da23d4cd8496497a8f6a0b2564e9f54bfbbc69a7b4e2be1

See more details on using hashes here.

File details

Details for the file enkeep_ctp-6.7.7.11-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7ab0a2e292efa9cd871979be1696c395b6dfbda748a93f6050a8a42c7fd15a4e
MD5 296568f4dfb8fe2b57155cb8a881e5f0
BLAKE2b-256 abda2cd1862b02006e6fa4a534d8736a4bd1917c285fd0c347516b7b58c94495

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.11-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7b8d29d2b5dcba46f4a373f98cd5dff33e42817de01141b4bb64192d2b1b8355
MD5 f9feb0c66806ae05d804d37d1e354b53
BLAKE2b-256 b21873a2b634ac3f7b090f51d384f6f062224a23cd545c6eb06870587f7a93d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for enkeep_ctp-6.7.7.11-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d7b32f088b11a9ed7f71c56e3031f47103f1c30b24845b7441cff1196a6dddf3
MD5 a2772140bd24e57ed40291e9ed6babe1
BLAKE2b-256 5f74a925314344c5542527f481cf51624fec7349b065bebb705e67b074504be7

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