# Asset Allocation

Asset allocation theory and optimizer usage, MPT / Black-Litterman / risk budgeting /...

- Repository: https://github.com/HKUDS/Vibe-Trading (37375 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add HKUDS/Vibe-Trading --skill asset-allocation -g -a claude-code -y`
Codex: `npx skills add HKUDS/Vibe-Trading --skill asset-allocation -g -a codex -y`
Cursor: `npx skills add HKUDS/Vibe-Trading --skill asset-allocation -g -a cursor -y`
Gemini CLI: `npx skills add HKUDS/Vibe-Trading --skill asset-allocation -g -a gemini-cli -y`

## Description

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

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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.

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