Skip to content

feat(portfolio): 新增影子组合审计模型 - #117

Open
andyaa423 wants to merge 1 commit into
TNT-Likely:mainfrom
andyaa423:codex/shadow-portfolio-schema
Open

andyaa423 wants to merge 1 commit into
TNT-Likely:mainfrom
andyaa423:codex/shadow-portfolio-schema

Conversation

@andyaa423

Copy link
Copy Markdown
Contributor

背景

为验证 TradingAgents 建议是否能改善真实持仓的风险收益,需要建立与实盘持仓隔离、可审计的影子组合基础数据。

变更内容

  • 新增 ShadowPosition 与 ShadowTrade 持久化模型,关联真实持仓与分析历史决策。
  • 保存模拟成交目标仓位、执行规则、成本 Fill 明细及执行状态,供后续执行和复盘使用。
  • TradingAgents 决策映射增加行情快照与 price_at_analysis,记录决策生成时可见价格。

验证

  • D:\PanWatch\.venv\Scripts\python.exe -m pytest tests/test_shadow_portfolio_models.py tests/test_tradingagents_5_tier_rating.py tests/test_tradingagents_agent.py -q
  • 结果:70 passed。
  • git diff --check 通过。

边界与风险

  • 本 PR 只建立数据模型和审计快照,不创建影子仓位,不执行建议,也不触碰真实账户或现有模拟盘。
  • 表由现有启动建表流程创建;生产迁移策略保持仓库现状。

后续计划

  • 下一项扩展 TradingAgents 到影子组合的决策桥接,覆盖减仓、卖出及止损兜底规则。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant