Portfolio demo / technical analysis & backtesting
SMA 50/200 Crossover on SPY
A rule-based trend strategy on 20 years of daily S&P 500 data, evaluated honestly against a buy-and-hold baseline. Real historical data, standard indicators, a fixed rule that was never tuned, and every metric reported—including where the strategy loses.
The strategy
- Hold SPY when
SMA(50) ≥ SMA(200); sit in cash otherwise. - Long/flat only — no shorting, no leverage, no position sizing.
- Signal reads the close of day t; the position takes effect day t+1.
- 5 bps round-trip cost per trade. Cash earns 0% (conservative against the strategy).
(50, 200) is the textbook golden-cross pair — decades old, not a value this project searched over. That’s deliberate: a rule you can’t have overfit is the only kind whose backtest means much.
Price, signals & equity curve
Performance vs. buy & hold
| Metric | Strategy | Buy & hold | Δ |
|---|
Trade log
| # | Entry | Exit | Days held | Net return | Result |
|---|
How to read this
Sharpe (rf = 0) — return per unit of total volatility. The check on whether higher returns are just higher risk.
Max drawdown — worst peak-to-trough equity decline. The number a trend rule is actually built to improve.
Win rate — share of closed trades in profit. Diagnostic only: a trend strategy is expected to be profitable at a sub-50% win rate.
Exposure — share of days with the position on. A strategy that is flat part of the time is taking less market risk, which reframes every other row.