Skip to content
Skillpedia
Analysis & spreadsheets37k · #7498

asset-allocation

What it does

This skill explains the main ways to split money across assets and how to run the built-in portfolio optimizers. It is for investors and analysts who want to understand allocation theory and apply it.

When to use it

  • ✓When you want to split a portfolio across several assets using a clear method.
  • ✓When you want to combine market views with a baseline allocation.
  • ✓When you want to use the optimizers and save the output to a config file.

Skill link

https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/asset-allocation/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/asset-allocation/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Build a risk-balanced allocation for these five ETFs, explain the method, and write the weights into the config file.”

5 new skills a week. 1 minute to read.

How it works

The agent explains the chosen method, such as mean-variance or risk budgeting, including its strengths and weaknesses. It then runs the matching optimizer with your constraints and writes the resulting weights into a configuration file.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Asset Allocation and Portfolio Optimization

Overview

From asset allocation theory to practical implementation, this skill covers classical frameworks (MPT, BL, risk budgeting, all-weather) and the usage of the four optimizers built into this system. The output can be written directly into config.json.

Asset Allocation Theory

1. Modern Portfolio Theory (MPT, Markowitz)

Core idea: maximize expected return for a given level of risk (the efficient frontier).

Optimization problem:
min  w'Σw              (portfolio variance)
s.t. w'μ = target_return
     Σw = 1
     w ≥ 0              (no shorting)
Advantages Disadvantages
Mathematically rigorous Extremely sensitive to inputs (garbage in, garbage out)
Efficient frontier is visualizable Concentrated-allocation problem (often produces extreme weights)
Foundational framework Assumes normality and ignores fat tails

Practical advice: do not use raw MPT directly. Add constraints (upper/lower bounds, sector limits) or use a regularized version.

2. Black-Litterman Model

Core idea: start from market equilibrium and incorporate investor views.

Steps:
1. Reverse-imply market equilibrium returns: π = δΣw_mkt
2. Build the view matrices: P (selection matrix), Q (view returns), Ω (view uncertainty)
3. Blend the posterior: μ_BL = [(τΣ)^-1 + P'Ω^-1 P]^-1 [(τΣ)^-1 π + P'Ω^-1 Q]
4. Run Markowitz optimization using posterior μ_BL

Example views:

  • Absolute view: "China A-shares will return 10% over the next year" → P=[1,0,0], Q=[0.10]
  • Relative view: "China A-shares will outperform US equities by 5%" → P=[1,-1,0], Q=[0.05]

Parameter guidance:

  • τ (uncertainty scaling): 0.025-0.05
  • Ω: set according to view confidence, where higher confidence = smaller variance

3. Risk Budgeting

Core idea: allocate by risk contribution rather than by capital share.

Risk contribution: RC_i = w_i × (Σw)_i / σ_p
Target: RC_i / σ_p = budget_i  (for all i)
Strategy Risk Budget Best Use Case
Equal risk contribution Each asset 1/N When you do not know which asset is best
Equity-tilted risk budget Stocks 60%, bonds 30%, commodities 10% When you want equities to contribute more risk
Dynamic risk budget Adjust dynamically by signal strength When you have market-timing ability

4. All-Weather Strategy

Bridgewater framework: allocate risk equally across economic environments.

Economic environment   Asset allocation
─────────              ─────────
Growth rising          Equities + commodities + corporate bonds
Growth falling         Government bonds + inflation-protected bonds
Inflation rising       Commodities + inflation-protected bonds + EM debt
Inflation falling      Equities + government bonds

Simplified allocation example for China-focused portfolios:
- 30% CSI 300 / CSI 500
- 40% government bonds / credit bonds
- 15% gold
- 15% commodities / REITs

Guide to the 5 Optimizers

Overview of the Built-In Optimizers

Configure them in config.json through optimizer and optimizer_params:

optimizer Display Name Core Idea Best Use Case
equal_volatility Equal Volatility Allocate weights by inverse volatility Simple and effective baseline
risk_parity Risk Parity Equalize risk contribution while accounting for correlation Long-term robust allocation
mean_variance Mean-Variance Maximize Sharpe ratio or minimize variance When return forecasts are available
max_diversification Maximum Diversification Maximize the diversification ratio When pursuing a low-correlation portfolio
turnover_aware Turnover-Aware Mean-variance utility with an L1 penalty on weight changes vs the previous rebalance When trading costs matter; tune turnover_penalty to your data frequency

1. equal_volatility

{
  "optimizer": "equal_volatility",
  "optimizer_params": {
    "lookback": 60
  }
}

Principle: w_i = (1/σ_i) / Σ(1/σ_j)

Parameter Default Description
lookback 60 Volatility calculation window (trading days)

Advantages: simple and fast, no return forecast required, no correlation matrix required.
Disadvantages: ignores cross-asset correlation.

2. risk_parity

{
  "optimizer": "risk_parity",
  "optimizer_params": {
    "
FAQ

Is raw mean-variance optimization enough?

The skill warns against using it alone, since results are very sensitive to inputs, and recommends adding constraints.

What is Black-Litterman?

It starts from a market baseline and adjusts it with your own views on specific assets.

Can the weights be used directly?

They can be written into the configuration file, but they should be reviewed before any real use.

Details

Original description by the author

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 5 optimizers and rebalancing rules.

repo: HKUDS/Vibe-Trading

Popularity

GitHub stars
37k
Ranking position
#7498
License
MIT
Updated
11/1/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills