{"id":26517375,"url":"https://github.com/namoshizun/tradepy","last_synced_at":"2025-06-10T22:38:45.189Z","repository":{"id":131758493,"uuid":"609789420","full_name":"namoshizun/TradePy","owner":"namoshizun","description":"Backtesting \u0026 Tradebot by the programmer, for the programmer. 一款温柔地对待程序员的量化框架 🤟","archived":false,"fork":false,"pushed_at":"2024-02-11T02:47:30.000Z","size":10744,"stargazers_count":25,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-02-11T03:28:24.287Z","etag":null,"topics":["algotrading","fintech","quantitative-trading","trading"],"latest_commit_sha":null,"homepage":"https://docs.trade-py.com/","language":"Python","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/namoshizun.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-03-05T08:38:15.000Z","updated_at":"2024-02-09T22:27:46.000Z","dependencies_parsed_at":"2023-12-13T14:39:41.351Z","dependency_job_id":"819dea26-2315-4697-b75d-31a1a0b48d09","html_url":"https://github.com/namoshizun/TradePy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namoshizun%2FTradePy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namoshizun%2FTradePy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namoshizun%2FTradePy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/namoshizun%2FTradePy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/namoshizun","download_url":"https://codeload.github.com/namoshizun/TradePy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244759936,"owners_count":20505716,"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":["algotrading","fintech","quantitative-trading","trading"],"created_at":"2025-03-21T08:19:56.592Z","updated_at":"2025-03-21T08:19:57.324Z","avatar_url":"https://github.com/namoshizun.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TradePy\n\n\u003cimg src=\"./docs/source/_static/logo.png\" width=\"150\" /\u003e\n\n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"https://github.com/namoshizun/TradePy/actions/workflows/deploy-sphinx-doc.yml/badge.svg?branch=main\u0026event=push\" /\u003e\n  \u003cimg src=\"https://github.com/namoshizun/TradePy/actions/workflows/run-tests.yml/badge.svg?branch=main\u0026event=push\" /\u003e \n\u003c/p\u003e\n\nTradePy是一个面向证券交易的量化策略开发 + 实盘交易框架，实现了如下功能:\n\n* **数据下载**\n  * 通过 [Akshare](https://github.com/akfamily/akshare/) 下载A股股票、ETF和宽基指数的日K，以及后复权因子、解禁日期等数据\n  * 通过 [XtQuant](http://docs.thinktrader.net/pages/4a989a) 下载日内1分钟K线。\n  * 数据下载为本地CSV或Pickle文件，不需要安装数据库，下载后即可离线使用\n  \n* **策略实现**: 提供声明式API以快速实现策略逻辑，内置多种常用指标，使用 [Numba](https://numba.pydata.org/) 加速耗时操作.\n\n* **策略回测**: 日K级别的交易回测，并生成回测报告。可用分钟K线做日内走势回测。\n\n  * 可设置 每日最大开仓数量、最低开仓金额、个股最大仓位\n  * 计算后复权股价，支持多种滑点设置\n  * 可并行跑多轮回测，观察策略表现的统计特征.\n\n* **寻参优化**: 基于网格搜索的参数寻优，并使用 [Dask Distributed](https://distributed.dask.org/) 做并行化。未来将集成更智能的寻参算法，当前也支持使用自定义的寻参算法。\n\n* **实盘交易**: 通过 [XtQuant](http://docs.thinktrader.net/pages/4a989a) 执行实盘交易，并自行统计当日持仓和账户余额等信息，以规避QMT终端的诸多数据反馈不及时问题。\n\n  * 每日自动更新日K数据。\n  * 支持设置委托单过期时间，超时不成交且不在当前买一价，可自动撤单.\n  * 支持微信推送交易行为和异常状态 （🚧施工中）\n\n* **实盘/回测对比**: 读取实盘的交割单PDF，并与同期的回测结果进行比对，以验证回测结果的可信度（🚧施工中）。\n\n\n**在线文档**: https://docs.trade-py.com\n\n**镜像仓库**: https://gitee.com/dilu3100/TradePy\n\n**TODOs**\n\n- [x] 测试用例\n- [ ] 日内交易回测\n- [ ] 微信推送交易行为\n- [ ] 加载实盘交割单，与回测结果对比\n- [ ] 回放回测中的交易行为\n- [ ] 优化回测报告\n- [ ] 调研在浏览器里使用TradePy回测功能的可行性\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamoshizun%2Ftradepy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamoshizun%2Ftradepy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamoshizun%2Ftradepy/lists"}