# vnpy-okex-pro
继承自[KandyYe的vnpy_okex](https://github.com/KandyYe/vnpy_okex)
获取交易产品历史K线数据改为使用OKX接口
```html
GET /api/v5/market/history-candles
```
## 安装
安装需要基于2.2.0版本以上的[VN Studio](https://www.vnpy.com)。
直接使用pip命令:
```
pip install vnpy_okex_pro
```
下载解压后在cmd中运行
```
python setup.py install
```
## 使用
以脚本方式启动(script/run.py):
```python
import vnpy_crypto
vnpy_crypto.init()
from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
# 上面固定不动
# ——————————————————————————————————————————————————
# Gateway
from vnpy_okex_pro import OkexGateway
# App
from vnpy_datamanager import DataManagerApp
def main():
"""主入口函数"""
qapp = create_qapp()
event_engine = EventEngine()
main_engine = MainEngine(event_engine)
# ——————————————————————————————————————————————————
# Gateway
main_engine.add_gateway(OkexGateway)
# App
main_engine.add_app(DataManagerApp)
# ——————————————————————————————————————————————————
main_window = MainWindow(main_engine, event_engine)
main_window.showMaximized()
qapp.exec()
if __name__ == "__main__":
main()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/monk-after-90s/vnpy-okex-pro",
"name": "vnpy-okex-pro",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "quant,quantitative,investment,trading,algotrading,ctp",
"author": "antas",
"author_email": "907333918@qq.com",
"download_url": "https://files.pythonhosted.org/packages/23/59/e171829bdf3074e64ea8fde2322ac6ae58b0a0d52c95d4f471c2a572070d/vnpy-okex-pro-2023.4.14.4.tar.gz",
"platform": null,
"description": "# vnpy-okex-pro\n\n\u7ee7\u627f\u81ea[KandyYe\u7684vnpy_okex](https://github.com/KandyYe/vnpy_okex)\n\n\u83b7\u53d6\u4ea4\u6613\u4ea7\u54c1\u5386\u53f2K\u7ebf\u6570\u636e\u6539\u4e3a\u4f7f\u7528OKX\u63a5\u53e3\n```html\nGET /api/v5/market/history-candles\n```\n\n## \u5b89\u88c5\n\n\u5b89\u88c5\u9700\u8981\u57fa\u4e8e2.2.0\u7248\u672c\u4ee5\u4e0a\u7684[VN Studio](https://www.vnpy.com)\u3002\n\n\u76f4\u63a5\u4f7f\u7528pip\u547d\u4ee4\uff1a\n\n```\npip install vnpy_okex_pro\n```\n\n\u4e0b\u8f7d\u89e3\u538b\u540e\u5728cmd\u4e2d\u8fd0\u884c\n\n```\npython setup.py install\n```\n\n## \u4f7f\u7528\n\n\u4ee5\u811a\u672c\u65b9\u5f0f\u542f\u52a8\uff08script/run.py\uff09\uff1a\n\n```python\nimport vnpy_crypto\n\nvnpy_crypto.init()\nfrom vnpy.event import EventEngine\nfrom vnpy.trader.engine import MainEngine\nfrom vnpy.trader.ui import MainWindow, create_qapp\n\n# \u4e0a\u9762\u56fa\u5b9a\u4e0d\u52a8\n# \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\n# Gateway\nfrom vnpy_okex_pro import OkexGateway\n# App\nfrom vnpy_datamanager import DataManagerApp\n\n\ndef main():\n \"\"\"\u4e3b\u5165\u53e3\u51fd\u6570\"\"\"\n qapp = create_qapp()\n event_engine = EventEngine()\n main_engine = MainEngine(event_engine)\n # \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\n # Gateway\n main_engine.add_gateway(OkexGateway)\n # App\n main_engine.add_app(DataManagerApp)\n # \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\n main_window = MainWindow(main_engine, event_engine)\n main_window.showMaximized()\n\n qapp.exec()\n\n\nif __name__ == \"__main__\":\n main()\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "OKEX gateway for vn.py quant trading framework.",
"version": "2023.4.14.4",
"split_keywords": [
"quant",
"quantitative",
"investment",
"trading",
"algotrading",
"ctp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7d750f5498f4e55b9bf51a66f1c3de5c2f38444240d83a24d6c24db78205bd46",
"md5": "77f04614c2324469745cfa209490e9ec",
"sha256": "de2278abb32726d3d48bd1093fb2d7ce382753cd4be8f5054e64a4abf677219f"
},
"downloads": -1,
"filename": "vnpy_okex_pro-2023.4.14.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "77f04614c2324469745cfa209490e9ec",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 11988,
"upload_time": "2023-04-14T05:58:43",
"upload_time_iso_8601": "2023-04-14T05:58:43.294057Z",
"url": "https://files.pythonhosted.org/packages/7d/75/0f5498f4e55b9bf51a66f1c3de5c2f38444240d83a24d6c24db78205bd46/vnpy_okex_pro-2023.4.14.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2359e171829bdf3074e64ea8fde2322ac6ae58b0a0d52c95d4f471c2a572070d",
"md5": "aa905765dc88d3a822f1c30e45c534b2",
"sha256": "278bcaefbd6a195340202df3524f1ed5d709ab4e23b5b963853ec1d44f8865b3"
},
"downloads": -1,
"filename": "vnpy-okex-pro-2023.4.14.4.tar.gz",
"has_sig": false,
"md5_digest": "aa905765dc88d3a822f1c30e45c534b2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12122,
"upload_time": "2023-04-14T05:58:45",
"upload_time_iso_8601": "2023-04-14T05:58:45.705578Z",
"url": "https://files.pythonhosted.org/packages/23/59/e171829bdf3074e64ea8fde2322ac6ae58b0a0d52c95d4f471c2a572070d/vnpy-okex-pro-2023.4.14.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-14 05:58:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "monk-after-90s",
"github_project": "vnpy-okex-pro",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "vnpy-okex-pro"
}