AI Agent Hub
Back to skills
Simulated Portfolio Trial Calculator icon

Simulated Portfolio Trial Calculator

Professional Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_cc9425b3/jy-portfolio-calculation-v2 using https://skillhub.cn/install/skillhub.md.

About this skill

What It Solves

Simulated portfolio trials often fail because interfaces are scattered, parameter conventions differ, and post-build or post-rebalance queries return stale state. This skill targets engineering and financial-analysis workflows that need quick validation of portfolio construction, weight changes, and performance results. It wraps PortfolioBuild, PortfolioRebalance, PortfolioPositionQuery, TradeFlowQuery, and PortfolioIndicatorQuery into a unified entry point. Users can describe the build date, securities, quantity or weights, and benchmark in natural language, and the skill returns a portfolio ID and chains the follow-up position, trade, and indicator queries.

How It Works

The core flow is write first, then read:
- Build or rebalance: call PortfolioBuild or PortfolioRebalance to obtain a 32-character portfolio ID.
- Serial queries: after the write succeeds, query positions, trade flow, and performance indicators in sequence to avoid reading a rebalance that has not yet taken effect.
- Report generation: use scripts/generate_portfolio_report_md.py for a Markdown report; PDF output depends on fpdf2 and is better for printing or sharing.

Query results should be rendered as structured tables and keep key fields such as secuCode, quantity, price, totalReturn, and maxRetreat so the portfolio logic can be audited.

Boundaries And Notes

  • Build and rebalance dates cannot be the current day or future dates; if a user supplies one, fall back to a valid historical date and state the adjustment clearly.
  • Total weights must equal 1; if they are below 1, cash can fill the gap, but if they exceed 1 the operation should be rejected.
  • Position, trade, and indicator queries must not run in parallel with build or rebalance calls, or they may miss the latest server-side state.
  • This skill is for simulated portfolio trials, data reconciliation, and report drafting, not for formal investment advice.

Use Cases

  • Build a historical Moutai and Ping An portfolio, get ID.
  • After rebalance, serially check positions, trades, Sharpe.
  • Explain simulated performance with a Markdown holdings report.
  • Check whether a security entered the portfolio by date.

Best For

  • quant researcher verifying post-rebalance positions and Sharpe
  • financial analyst drafting a simulated portfolio return report
  • data engineer checking security inclusion by date
  • portfolio manager preparing strategy review materials