Portfolio optimization
Reusable Agent Skills for quantitative finance research, extracted from the Aria toolchain.
npx -y skills add artherahq/skills --skill portfolio-optimizationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Produce defensible portfolio weights from return history, and check whether the optimizer earns its complexity. Trigger for "帮我优化组合权重", "风险平价配置", "怎么配这几只资产", "降低组合波动怎么调仓", "optimize my portfolio", "risk parity allocation", "rebalance weights", or whenever the user (1) holds several assets and asks how much of each, (2) wants lower volatility/drawdown via allocation, (3) asks equal weight vs something smarter, or (4) receives strategy signals that need converting into weights. Do NOT trigger for single-asset position sizing (execution question) or for judging portfolio risk after the fact (risk-assessment).
SKILL.md
3.4 KB, as published. Nobody here has run it
Portfolio Optimization
Optimizers amplify the noise in their inputs, and the noisiest input in finance is the expected return. This skill therefore optimizes risk structure only — and always asks the question most optimizers dodge: did the clever method beat equal weight out-of-sample?
Principles
- No expected-return inputs. Sample means are noise; MVO on sample means is noise squared. The methods here (inverse vol, min variance, ERC risk parity, HRP) need only the covariance structure. If the user brings views, the honest framing is scenario analysis, not a mean-variance frontier.
- Equal weight is the benchmark, not the strawman. The
comparemode walk-forwards every method against EW;optimizer_no_edgeis a first-class finding, common in practice, and worth telling the user plainly. - Estimation error is disclosed, not hidden. Covariance is shrunk toward an identity target when the panel is short relative to breadth, and the report states the intensity. T < 2N earns a wide-error-bars note.
- Weights describe risk, not conviction. The disclosure lines say so and must be surfaced.
Workflow
- Assemble the return matrix (shared dates, per-asset periodic returns) and any constraints (max weight per asset). Confirm the frequency.
- Start with the comparison, not a single method:
python scripts/optimize_portfolio.py --returns returns.csv --method compare— walk-forward OOS vol/Sharpe/maxDD per method vs equal weight. - Pick the method the comparison actually supports. Defaults when the
comparison is inconclusive:
hrpfor structured books (clusters visible),ercwhen the user wants balanced risk,equalwhen nothing beats it. - Produce weights:
--method hrp --max-weight 0.25 --json weights.json. Report weights, portfolio vol, effective N, and per-asset risk contributions together — a weight table without risk contributions hides exactly what the user needs to see. - Hand the resulting book to
risk-assessmentfor the full profile (concentration, tails, stress) before anyone acts on it. - Rebalancing advice must state turnover implications — weights that change 10% a month feed the cost ladder in backtest-validation.
Guardrails
- No mean-variance frontiers from sample means; no implied return forecasts.
optimizer_no_edgefindings are reported, not suppressed.- Shrinkage intensity and estimation-error notes are part of the deliverable.
- Weights are research output, not individualized investment advice — the disclosure lines ship with every result.
- Live execution is out of scope; the strongest recommendation is a paper rebalance reviewed by the user.