This commit is contained in:
2026-09-19 19:45:43 +08:00
parent 7183cb45f8
commit 8131b158b4
60 changed files with 7669 additions and 909 deletions

View File

@@ -35,11 +35,19 @@ py -3.14 -m venv .venv
## 验证与性能
测试与基准已统一迁到仓库根的 `labs/`(试验与测试代码集中目录),
从**仓库根目录**执行:
```powershell
.venv/Scripts/python.exe -B -m unittest discover -s tests -v
.venv/Scripts/python.exe -B benchmarks/hotpaths.py
py -3.14 -B labs/run_tests.py # 全部离线测试(统一入口)
py -3.14 -B labs/run_tests.py -v # 详细
py -3.14 -B labs/benchmarks/hotpaths.py # 微基准
```
`labs/run_tests.py` 会自动把本目录(`py-client`)挂上 `sys.path`
所以不需要先 `cd py-client`;测试模块用 `from tests.zt_harness import ...`
这类绝对导入,也由该入口统一处理顶层包名。
130 项离线测试通过,覆盖 SDK 与 API 字段契约、委托簿、配置校验、IPO 申购状态机、
ZT 轮次状态机正T/反T、Trend 采集任务与 Python 3.14 回归。
测试使用模拟客户端和临时目录,不启动真实交易、不访问真实接口。
@@ -64,7 +72,8 @@ ZT 轮次状态机正T/反T、Trend 采集任务与 Python 3.14 回归。
## ETF 自适应网格策略
入口为 `strategy: etf`,标的和参数见 [`etc/etf.yaml`](etc/etf.yaml)
入口为 `strategy: etf`,标的和参数见 [`etc/_etf.yaml`](etc/_etf.yaml)(由
`config.load()` 按固定文件名加载,文件不存在时为 `None`
完整规则和启用步骤见 [`strategy/etf/README.md`](strategy/etf/README.md)。
## ZT 做 T 策略2026-09 重构)