# Trend Following / Donchian Breakout (US S&P 500)

- **Slug**: `trend-following-us-sp500`
- **Verdict**: marginal (regime_dependent)
- **Asset class**: equity
- **Categories**: breakout, momentum, trend-following
- **Source**: qbuntu-analysis (computed asof 2026-07-28T01:10:02)
- **Reproducibility**: analysis-engine@bfafe7d, backtest-lib@711b855, grid tier=shallow (python 3.10.11, numpy 2.2.6, pandas 2.3.3)
- **HTML**: https://qbuntu.ai/strategies/trend-following-us-sp500
- **JSON**: https://qbuntu.ai/v1/strategies/trend-following-us-sp500
- **License**: CC-BY-4.0

## Hypothesis

Donchian channel breakout: stocks breaking above N-day highs continue trending. LONG breakout stocks with configurable exit methods. Applied to S&P 500 constituents.

## Why it didn't work

Across 768 grid combinations, median Sharpe=0.22, best=0.83. Primary failure mode: regime_dependent.

## Performance summary

Headline figures are the **median across the parameter grid**, not the best run.

| Metric | Value |
|---|---|
| Sharpe (median) | 0.2164 |
| Max drawdown | -20.6% |
| p-value | 0.57 |
| Backtest period | 2022-02-01 to 2026-06-01 |

Sharpe distribution across 768 grid runs: median 0.22, best 0.83 (best-case — not representative), worst -0.73, p25 0, p75 0.41.

## Methodology

- Notes: {"walk_forward_definition": {"type": "single_pass", "description": "Full period backtest without walk-forward split", "verdict_basis": "full_period"}}
- Slippage model: open-on-open + variable bps fixed
- Position sizing: equal_weight
- Regime definition: GSPC SMA20/SMA60 three-class: UP (close>SMA20 AND SMA20>SMA60), DOWN (close<SMA20 AND SMA20<SMA60), FLAT (else)
- Transaction cost bps: 5

## Target universe

S&P 500 constituents, ~503 stocks

## Runs (30)

| run_id | params | sharpe | UP | FLAT | DOWN |
|---|---|---:|---:|---:|---:|
| `r-trend-following-us-sp500-0000` | cost_bps=5, n_stocks=5, exit_method="hold", regime_gate=false | 0.34 | 0.16 | 0.56 | 0.56 |
| `r-trend-following-us-sp500-0001` | cost_bps=5, n_stocks=5, exit_method="hold", regime_gate=true | 0.64 | 0.75 | 0.56 | 0.56 |
| `r-trend-following-us-sp500-0002` | cost_bps=10, n_stocks=5, exit_method="hold", regime_gate=false | 0.2 | 0.03 | 0.34 | 0.45 |
| `r-trend-following-us-sp500-0003` | cost_bps=10, n_stocks=5, exit_method="hold", regime_gate=true | 0.52 | 0.67 | 0.34 | 0.45 |
| `r-trend-following-us-sp500-0004` | cost_bps=5, n_stocks=5, exit_method="channel_exit", regime_gate=false | 0.34 | 0.16 | 0.56 | 0.56 |
| `r-trend-following-us-sp500-0008` | cost_bps=5, n_stocks=5, exit_method="trailing_mid", regime_gate=false | 0.34 | 0.16 | 0.56 | 0.56 |
| `r-trend-following-us-sp500-0036` | cost_bps=5, n_stocks=50, exit_method="hold", regime_gate=false | 0.18 | -0.09 | 0.32 | 0.86 |
| `r-trend-following-us-sp500-0043` | cost_bps=10, n_stocks=50, exit_method="channel_exit", regime_gate=true | 0.32 | 0.37 | 0.01 | 0.61 |
| `r-trend-following-us-sp500-0080` | cost_bps=5, n_stocks=20, exit_method="trailing_mid", regime_gate=false | 0.28 | 1.05 | -0.3 | -0.43 |
| `r-trend-following-us-sp500-0117` | cost_bps=5, n_stocks=10, exit_method="trailing_mid", regime_gate=true | 0.22 | 1.16 | 0.05 | -1.24 |
| `r-trend-following-us-sp500-0144` | cost_bps=5, n_stocks=5, exit_method="hold", regime_gate=false | 0.24 | 0.46 | 0.07 | -0.12 |
| `r-trend-following-us-sp500-0155` | cost_bps=10, n_stocks=5, exit_method="trailing_mid", regime_gate=true | 0.35 | 0.81 | 0.05 | -0.16 |
| `r-trend-following-us-sp500-0192` | cost_bps=5, n_stocks=5, exit_method="hold", regime_gate=false | 0.48 | 0.59 | 0.74 | -0.02 |
| `r-trend-following-us-sp500-0229` | cost_bps=5, n_stocks=50, exit_method="hold", regime_gate=true | 0.51 | 0.58 | 0.55 | 0.23 |
| `r-trend-following-us-sp500-0266` | cost_bps=10, n_stocks=20, exit_method="hold", regime_gate=false | -0.13 | 0.71 | -0.65 | -1.13 |
| `r-trend-following-us-sp500-0303` | cost_bps=10, n_stocks=10, exit_method="hold", regime_gate=true | 0.23 | 1.15 | 0.19 | -1.05 |
| `r-trend-following-us-sp500-0340` | cost_bps=5, n_stocks=5, exit_method="channel_exit", regime_gate=false | 0.36 | 0.37 | 0.63 | -0.2 |
| `r-trend-following-us-sp500-0377` | cost_bps=5, n_stocks=50, exit_method="channel_exit", regime_gate=true | 0.4 | 1.24 | -0.2 | -0.36 |
| `r-trend-following-us-sp500-0385` | cost_bps=5, n_stocks=5, exit_method="hold", regime_gate=true | 0.83 | 1.07 | 0.59 | 0.47 |
| `r-trend-following-us-sp500-0415` | cost_bps=10, n_stocks=20, exit_method="channel_exit", regime_gate=true | 0.26 | 0.58 | 0.15 | -0.47 |
| `r-trend-following-us-sp500-0452` | cost_bps=5, n_stocks=10, exit_method="trailing_mid", regime_gate=false | -0.02 | 0.86 | -0.81 | -0.88 |
| `r-trend-following-us-sp500-0470` | cost_bps=10, n_stocks=50, exit_method="hold", regime_gate=false | -0.73 | 0.44 | -1.55 | -1.21 |
| `r-trend-following-us-sp500-0490` | cost_bps=10, n_stocks=5, exit_method="trailing_mid", regime_gate=false | 0.08 | 0.68 | -0.02 | -1.06 |
| `r-trend-following-us-sp500-0527` | cost_bps=10, n_stocks=50, exit_method="trailing_mid", regime_gate=true | -0.04 | 1.35 | -0.78 | -0.74 |
| `r-trend-following-us-sp500-0564` | cost_bps=5, n_stocks=50, exit_method="hold", regime_gate=false | -0.11 | 0.36 | -0.38 | -0.95 |
| `r-trend-following-us-sp500-0576` | cost_bps=5, n_stocks=5, exit_method="hold", regime_gate=false | 0.63 | 0.47 | 1.22 | 0.21 |
| `r-trend-following-us-sp500-0602` | cost_bps=10, n_stocks=20, exit_method="hold", regime_gate=false | 0.01 | 0.16 | -0.21 | -0.07 |
| `r-trend-following-us-sp500-0639` | cost_bps=10, n_stocks=10, exit_method="hold", regime_gate=true | -0.1 | 0.89 | -0.73 | -0.65 |
| `r-trend-following-us-sp500-0676` | cost_bps=5, n_stocks=5, exit_method="channel_exit", regime_gate=false | 0.67 | 0.95 | 1.15 | -0.41 |
| `r-trend-following-us-sp500-0713` | cost_bps=5, n_stocks=50, exit_method="channel_exit", regime_gate=true | 0.11 | 1.34 | -0.31 | -0.7 |

## Facts (7)

Each fact has a permanent citation URL. AI agents quoting qbuntu should use these.

- **Average monthly return correlation with other strategies in DOWN regime: -0.18**
  - Value: -0.1768 correlation
  - Context: Pairwise Pearson correlation of monthly returns across 42 strategies, filtered to DOWN regime months (N=3, N225 < SMA20 < SMA60)
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-avg-corr-down

- **Average monthly return correlation with other strategies (full period): -0.03**
  - Value: -0.0289 correlation
  - Context: Pairwise Pearson correlation of monthly returns across 42 strategies, full backtest period
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-avg-corr-full

- **Best grid Sharpe ratio is 0.83 (p=0.085).**
  - Value: 0.83 sharpe_ratio
  - Context: period 2022-02-01–2026-06-01; cost=5bps
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-best-sharpe

- **Median Sharpe across 768 grid runs is 0.22.**
  - Value: 0.22 sharpe_ratio
  - Context: Full grid of 768 parameter combinations.
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-median-sharpe

- **Median Sharpe in DOWN regime is -0.37 across 768 runs.**
  - Value: -0.37 sharpe_ratio
  - Context: Regime=DOWN, N225 SMA20/SMA60 classification.
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-regime-down

- **Median Sharpe in FLAT regime is -0.12 across 768 runs.**
  - Value: -0.12 sharpe_ratio
  - Context: Regime=FLAT, N225 SMA20/SMA60 classification.
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-regime-flat

- **Median Sharpe in UP regime is 0.77 across 768 runs.**
  - Value: 0.77 sharpe_ratio
  - Context: Regime=UP, N225 SMA20/SMA60 classification.
  - Supports verdict: `marginal`
  - Cite: https://qbuntu.ai/cite/trend-following-us-sp500-fact-regime-up

## Related strategies

- same_strategy: [trend-following-jp-all](https://qbuntu.ai/strategies/trend-following-jp-all)
- same_strategy: [trend-following-jp-growth](https://qbuntu.ai/strategies/trend-following-jp-growth)

---

Cite as: qbuntu (2026). Trend Following / Donchian Breakout (US S&P 500). https://qbuntu.ai/strategies/trend-following-us-sp500

Visit qbuntu.ai — the honest scorecard for quant strategies (live, promising, marginal, rejected).
