{"id":16939088,"url":"https://github.com/vnpy/vnpy_tts","last_synced_at":"2025-04-11T19:20:26.096Z","repository":{"id":41882661,"uuid":"386162455","full_name":"vnpy/vnpy_tts","owner":"vnpy","description":"VeighNa框架的TTS交易接口（模拟CTP环境）","archived":false,"fork":false,"pushed_at":"2024-12-26T03:13:45.000Z","size":12014,"stargazers_count":17,"open_issues_count":1,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T15:12:17.119Z","etag":null,"topics":["ctp","python","veighna","vnpy"],"latest_commit_sha":null,"homepage":"https://www.vnpy.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vnpy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-15T04:28:19.000Z","updated_at":"2025-03-17T15:50:22.000Z","dependencies_parsed_at":"2025-02-20T00:32:55.347Z","dependency_job_id":"e07cd225-937f-4742-804d-7393b2369258","html_url":"https://github.com/vnpy/vnpy_tts","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_tts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_tts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_tts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vnpy%2Fvnpy_tts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vnpy","download_url":"https://codeload.github.com/vnpy/vnpy_tts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465348,"owners_count":21108244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ctp","python","veighna","vnpy"],"created_at":"2024-10-13T21:03:37.834Z","updated_at":"2025-04-11T19:20:26.072Z","avatar_url":"https://github.com/vnpy.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VeighNa框架的TTS仿真系统交易接口\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src =\"https://vnpy.oss-cn-shanghai.aliyuncs.com/vnpy-logo.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src =\"https://img.shields.io/badge/version-6.7.2.1-blueviolet.svg\"/\u003e\n    \u003cimg src =\"https://img.shields.io/badge/platform-windows|linux-yellow.svg\"/\u003e\n    \u003cimg src =\"https://img.shields.io/badge/python-3.10|3.11|3.12-blue.svg\"/\u003e\n    \u003cimg src =\"https://img.shields.io/github/license/vnpy/vnpy.svg?color=orange\"/\u003e\n\u003c/p\u003e\n\n## 说明\n\n基于TTS的6.7.2接口封装开发，对接类CTP的仿真交易环境。\n\n目前TTS支持的仿真交易包括：\n\n- 期货\n    - 中金所\n    - 上期所\n    - 大商所\n    - 郑商所\n    - 广期所\n    - 能交所\n- 股票\n    - 上交所\n    - 深交所\n\n## 安装\n\n安装环境推荐基于3.9.0版本以上的【[**VeighNa Studio**](https://www.vnpy.com)】。\n\n直接使用pip命令：\n\n```\npip install vnpy_tts\n```\n\n\n或者下载源代码后，解压后在cmd中运行：\n\n```\npip install .\n```\n\n使用源代码安装时需要进行C++编译，因此在执行上述命令之前请确保已经安装了【Visual Studio（Windows）】或者【GCC（Linux）】编译器。\n\n\n## 使用\n\n以脚本方式启动（script/run.py）：\n\n```\nfrom vnpy.event import EventEngine\nfrom vnpy.trader.engine import MainEngine\nfrom vnpy.trader.ui import MainWindow, create_qapp\n\nfrom vnpy_tts import TtsGateway\n\n\ndef main():\n    \"\"\"主入口函数\"\"\"\n    qapp = create_qapp()\n\n    event_engine = EventEngine()\n    main_engine = MainEngine(event_engine)\n    main_engine.add_gateway(TtsGateway)\n    \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\n## 连接\n\n模拟账号可通过https://github.com/krenx1983/openctp 获取。\n\n连接信息如下：\n\n```\n{\n    \"用户名\": \"xxxxxx\",\n    \"密码\": \"xxxxxx\",\n    \"经纪商代码\": \"\",\n    \"交易服务器\": \"121.36.146.182:20002\",\n    \"行情服务器\": \"121.36.146.182:20004\",\n    \"产品名称\": \"\",\n    \"授权编码\": \"\"\n}\n```\n7x24小时环境：\n    交易服务器 - 122.37.80.177:20002\n    行情服务器 - 122.37.80.177:20004\n\n经纪商代码、产品名称、授权编码三项可以不填。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnpy%2Fvnpy_tts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvnpy%2Fvnpy_tts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvnpy%2Fvnpy_tts/lists"}