bothpy-ctp


Namebothpy-ctp JSON
Version 6.6.7.5 PyPI version JSON
download
home_page
SummaryCTP gateway for bothpy quant trading framework.
upload_time2024-01-30 02:51:40
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords quant quantitative investment trading algotrading ctp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 说明

基于CTP期货版的6.6.7接口封装开发,接口中自带的是【穿透式实盘环境】的dll文件。
由 vnpy_ctp 修改而来

## 打包

```
python setup.py bdist_wheel
```

需要进行C++编译,因此在执行上述命令之前请确保已经安装了【Visual Studio(Windows)】、【GCC(Linux)】、【XCode(Mac)】编译器。

## 发布

先安装一下 twine:

```
python -m pip install twine
twine upload dist/*
```
没有账户去注册一个  https://pypi.org/

## 安装

直接使用pip命令:

```
pip install bothpy_ctp
```

## 使用

以脚本方式启动(script/run.py):

```
from bothpy.event import EventEngine
from bothpy.trader.engine import MainEngine
from bothpy.trader.ui import MainWindow, create_qapp

from bothpy_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()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "bothpy-ctp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "quant,quantitative,investment,trading,algotrading,ctp",
    "author": "",
    "author_email": "",
    "download_url": "",
    "platform": null,
    "description": "## \u8bf4\u660e\r\n\r\n\u57fa\u4e8eCTP\u671f\u8d27\u7248\u76846.6.7\u63a5\u53e3\u5c01\u88c5\u5f00\u53d1\uff0c\u63a5\u53e3\u4e2d\u81ea\u5e26\u7684\u662f\u3010\u7a7f\u900f\u5f0f\u5b9e\u76d8\u73af\u5883\u3011\u7684dll\u6587\u4ef6\u3002\r\n\u7531 vnpy_ctp \u4fee\u6539\u800c\u6765\r\n\r\n## \u6253\u5305\r\n\r\n```\r\npython setup.py bdist_wheel\r\n```\r\n\r\n\u9700\u8981\u8fdb\u884cC++\u7f16\u8bd1\uff0c\u56e0\u6b64\u5728\u6267\u884c\u4e0a\u8ff0\u547d\u4ee4\u4e4b\u524d\u8bf7\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86\u3010Visual Studio\uff08Windows\uff09\u3011\u3001\u3010GCC\uff08Linux\uff09\u3011\u3001\u3010XCode\uff08Mac\uff09\u3011\u7f16\u8bd1\u5668\u3002\r\n\r\n## \u53d1\u5e03\r\n\r\n\u5148\u5b89\u88c5\u4e00\u4e0b twine\uff1a\r\n\r\n```\r\npython -m pip install twine\r\ntwine upload dist/*\r\n```\r\n\u6ca1\u6709\u8d26\u6237\u53bb\u6ce8\u518c\u4e00\u4e2a  https://pypi.org/\r\n\r\n## \u5b89\u88c5\r\n\r\n\u76f4\u63a5\u4f7f\u7528pip\u547d\u4ee4\uff1a\r\n\r\n```\r\npip install bothpy_ctp\r\n```\r\n\r\n## \u4f7f\u7528\r\n\r\n\u4ee5\u811a\u672c\u65b9\u5f0f\u542f\u52a8\uff08script/run.py\uff09\uff1a\r\n\r\n```\r\nfrom bothpy.event import EventEngine\r\nfrom bothpy.trader.engine import MainEngine\r\nfrom bothpy.trader.ui import MainWindow, create_qapp\r\n\r\nfrom bothpy_ctp import CtpGateway\r\n\r\n\r\ndef main():\r\n    \"\"\"\u4e3b\u5165\u53e3\u51fd\u6570\"\"\"\r\n    qapp = create_qapp()\r\n\r\n    event_engine = EventEngine()\r\n    main_engine = MainEngine(event_engine)\r\n    main_engine.add_gateway(CtpGateway)\r\n  \r\n    main_window = MainWindow(main_engine, event_engine)\r\n    main_window.showMaximized()\r\n\r\n    qapp.exec()\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CTP gateway for bothpy quant trading framework.",
    "version": "6.6.7.5",
    "project_urls": null,
    "split_keywords": [
        "quant",
        "quantitative",
        "investment",
        "trading",
        "algotrading",
        "ctp"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f8eb8bcbbdc69d3360f9f4e37905ff2dcce61a8760c1a1db8ca90fabc0113643",
                "md5": "594cfe6d00d5a097cffc00d6517bbfff",
                "sha256": "185af472725b36eba57f8a3fd033936a35238c985262b22e304e14065be02f40"
            },
            "downloads": -1,
            "filename": "bothpy_ctp-6.6.7.5-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "594cfe6d00d5a097cffc00d6517bbfff",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7",
            "size": 18876856,
            "upload_time": "2024-01-30T02:51:40",
            "upload_time_iso_8601": "2024-01-30T02:51:40.599500Z",
            "url": "https://files.pythonhosted.org/packages/f8/eb/8bcbbdc69d3360f9f4e37905ff2dcce61a8760c1a1db8ca90fabc0113643/bothpy_ctp-6.6.7.5-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-30 02:51:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "bothpy-ctp"
}
        
Elapsed time: 2.87969s