AI Agent Hub
Back to skills
⚖️

Portfolio Optimization Master

Professional Updated 2026.08.30

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

Please install @user_053d27d0/portfolio-optimizer-zx following https://skillhub.cn/install/skillhub.md.

About this skill

What Problem It Solves

When designing asset allocations, return targets, sample covariance, investor views, risk contributions, and clustering structure are often handled as separate scripts. portfolio-optimizer-zx puts these steps into one Python workflow: it pulls A-share daily data from akshare, estimates covariance, and produces comparable weight solutions from different optimizers. It is better suited for quant learning and research prototyping than live trading.

How It Works

The tool covers four common strategies:

  • Markowitz: computes maximum Sharpe, minimum variance, and the efficient frontier, with weight bounds and shorting constraints.
  • Black-Litterman: derives equilibrium returns from market weights, blends absolute or relative views, and estimates view uncertainty automatically.
  • Risk parity: targets similar risk contributions from each asset, then reports marginal risk contribution and risk share.
  • HRP: allocates weights through hierarchical clustering and recursive bisection, avoiding direct covariance matrix inversion.

It then summarizes annualized return, volatility, Sharpe ratio, maximum drawdown, Calmar, Sortino, information ratio, VaR, and CVaR, and can generate an HTML report with the efficient frontier, weight pie chart, risk contribution, and correlation heatmap.

Boundaries

The skill currently depends on A-share interfaces and daily data, so it is not intended for high-frequency trading, options/futures portfolios, or real-time execution. akshare failures, short samples, unstable covariance estimates, and biased investor views can all affect results. Treat the output as research material, not investment advice.

Use Cases

  • A researcher compares Markowitz, Black-Litterman, risk parity, and HRP weights for the same A-share basket.
  • A quant learner builds an efficient frontier from real A-share daily data and tests weight bounds on max Sharpe.
  • An investment research team consolidates risk contribution, correlation heatmaps, and performance metrics into one HTML report.
  • A student uses Ledoit-Wolf shrinkage to replace unstable sample covariance in an asset allocation course project.

Best For

  • A-share quant researchers who need to compare weights and performance across allocation algorithms.
  • Students learning portfolio theory who need real daily A-share data to reproduce course models.
  • Analysts writing research reports who need risk contribution, efficient frontier, and metrics in one HTML output.
  • Quant engineers building strategy prototypes who need to test weight bounds, covariance estimation, and view inputs.