Commit Graph

10 Commits

Author SHA1 Message Date
claude_dev 252deb5ec7 feat(api): paper positions/pending 端点(实走监控用,Phase 3c Live页后端基础) 2026-07-09 22:33:35 +08:00
claude_dev 193064c953 feat(trader): 软限额max_allocation(分期项)—每策略资金额度消除顺序依赖
spec §195: 多策略并发下单"先到后到"不可复现 → 每策略独立max_allocation
- StrategyRunner: max_allocation字段(默认inf) + used_allocation(持仓市值)
- engine._match: BUY cash_enough后查 used+成交额>max_allocation → 拒单max_allocation_exceeded
- live_orchestrator: runner传max_allocation(默认initial_capital)
- routes_paper: StrategyCfg加max_allocation(API→DB→live_step数据流)
- test_soft_limit: 3测试(累计超限拒单/默认不限/SELL不受限)

116 passed(113旧+3新), 无回归.
2026-07-09 22:05:35 +08:00
claude_dev 7eec983164 fix(live): C-S3实走warmup(am跨日)+fetch_day wrapper+端到端验证
- live_orchestrator warmup: 重放start~昨日raw到策略am使其inited(实走每日单根, 不warmup则ArrayManager永不inited→策略无信号)
- routes _DataSourceWrapper 加 fetch_day(给 live_step 拉当日raw)
- verify_live_step 容器端到端: 创建live account+live_step(07-07 warmup+step)+存pending, 跑通(pending=0系DoubleMa当日无交叉, 撮合/存已单测)
2026-07-08 06:59:24 +08:00
claude_dev 6931a7b541 feat(trader): C-S3实走后端骨架—live_orchestrator+全局scheduler job+routes live
架构(简化,避per-account闭包注入):
- live_orchestrator live_step(account_id)自包含: 恢复cash/positions/pending→fetch_day raw当日→engine.step→存状态
- run_live_step(db)遍历live accounts调live_step; scheduler register_live_step_job全局20:30 job
- app startup注册全局job; routes create mode=live存account running(不跑回放)
- TODO(分期项): prev_close昨日raw/listing_days IPO算/realized_pnl恢复
- 113/113通过, live_orchestrator import OK
2026-07-08 06:49:31 +08:00
claude_dev 05dba7fe46 feat(trader): 科创板200股最小手数(分期项切片)—lot_size_for+matcher板块取整
科创板(688/689)最小200股1股递增(不整倍); 主板/创业/北交100整倍; 卖出不取整。
- limit.py 加 lot_size_for(symbol)
- matcher cross_order 买入取整按板块(star≥200不取整, 其余100整倍)
- routes_paper cta size=lot_size_for(symbol)
- test: 688981 买150拒/买250不取整; 主板用例不变; 63/63通过
2026-07-07 23:37:50 +08:00
claude_dev ba2138e1cf fix(trader): volume×size(A股1手=100股) — DoubleMa 真策略回放 filled=3 跑通 2026-07-07 15:15:27 +08:00
claude_dev 17a4801450 fix(trader): vnpy 桥接(am/trading/cancel_all/__getattr__兜底) + create 异步回放 2026-07-07 15:03:57 +08:00
claude_dev eb6aa34b82 fix(paper): create 接入回放(engine.run) + 日线 parquet 文件名 sh/sz 前缀+_daily 2026-07-07 14:47:20 +08:00
claude_dev 14088eac13 feat(paper): C-S2 分策略归因(/strategies 聚合成交/拒单/费用) 2026-07-07 12:07:37 +08:00
claude_dev 041dca59e2 feat(api): /paper/* 路由(create建account+equity/trades查询,JWT) 2026-07-07 12:06:26 +08:00