Quant BuffetRelax, Not Over Thinking

Lesson 6 · 20 min

Performance metrics & debugging

Sharpe, drawdown, CAGR — and fixing the errors you will see in the lab.

SharpeDrawdownDebug

A backtest without metrics is just a chart. Quant Buffet reports risk-adjusted statistics so you can compare strategies — and provides an AI debugger when code breaks.

Drag the sliders to see how Sharpe and Calmar react. These are the same families of stats Quant Buffet reports after a lab run.

Sharpe (approx.)
0.44
(CAGR − RF) / Vol
Calmar (approx.)
0.55
CAGR / |Max DD|
Interpretation

Weak — check overfitting or costs

Lab errorLikely fix
Signal never readyShorten lookback or extend start date; check ASSETS history.
Import blockedOnly backtest.*, numpy, pandas — see API docs.
Symbol not in whitelistUse ETFs from backtest.universes (SPY, TLT, GLD…).
Equity curve too shortEnsure on_day actually calls set_target_weights.

Metrics glossary

MetricWhat it tells youHealthy scepticism
CAGRAverage yearly growth if path repeatedOne great decade can inflate it
VolatilityHow bumpy the ride isLow vol can mean hidden leverage
SharpeReturn per unit of riskMeaningless if only 2 years of data
Max drawdownWorst peak-to-trough lossCan you hold through it live?
Alpha / BetaExcess return vs SPY; market sensitivityProxy benchmark ≠ your live book
Win rate% of positive daysHigh win rate can still lose money

Debugging workflow

  1. Read the error message and line number in the lab panel.
  2. Open the syntax cheat sheet — compare to required ASSETS + make_on_day.
  3. Click Ask AI for syntax — step-by-step fixes with copy-paste snippets.
  4. Consult API docs for imports, whitelist symbols, and template examples.
  5. Re-run with a shorter ASSETS list and later start date to isolate data issues.
# After a local or lab run
metrics = compute_metrics(result.equity, benchmark=spy_bh, trades_count=len(result.trades))
print(metrics["sharpe"], metrics["max_drawdown"])