Skip to content

feat: batch portfolio summary - #24

Merged
XucroYuri merged 4 commits into
mainfrom
goratio-dev-batch-portfolio
Sep 3, 2026
Merged

feat: batch portfolio summary#24
XucroYuri merged 4 commits into
mainfrom
goratio-dev-batch-portfolio

Conversation

@XucroYuri

Copy link
Copy Markdown
Owner

新增 summarize_batch_portfolio,汇总批量持仓模拟、资金曲线与保证金占用。

Copilot AI lite review requested due to automatic review settings September 3, 2026 00:24
@XucroYuri
XucroYuri merged commit 678650a into main Sep 3, 2026
11 checks passed
@XucroYuri
XucroYuri deleted the goratio-dev-batch-portfolio branch September 3, 2026 00:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

新增测试目前断言过弱且 Changelog 条目格式不一致,建议补强断言与统一文档格式后再合入。

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

该 PR 在 goratio.margin 中新增一个高层封装函数,用于将批量 episode 的持仓模拟结果汇总为资金曲线与保证金占用统计,便于研究调用方一次性获取核心摘要输出。

Changes:

  • 新增 summarize_batch_portfolio():封装 run_position_simulation + batch_equity_summary + margin_utilization_summary 的批量汇总返回结构
  • 新增对应单元测试用例并更新 Changelog/Roadmap 记录
File summaries
File Description
tests/test_margin.py 增加 summarize_batch_portfolio 的测试用例入口
src/goratio/margin.py 新增批量持仓汇总函数,返回 simulation/equity/margin_utilization 组合结果
CHANGELOG.md 记录新增 API 条目
.planning/ROADMAP.md 勾选完成项并更新测试数量
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md
Comment on lines +54 to +55
- `position_pnl_estimate()` 增加资金成本与净 P&L 估算;
- `summarize_batch_portfolio()`:批量 episode → 持仓模拟 → 资金/保证金高层汇总。
Comment thread tests/test_margin.py
Comment on lines +300 to +305
summary = summarize_batch_portfolio(records, [episode])

self.assertIn("simulation", summary)
self.assertIn("equity", summary)
self.assertIn("margin_utilization", summary)

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.

2 participants