Strategy backtest: S&P 500
Each model's prediction at today's close sets tomorrow's position (long or flat). Returns are daily log returns over the test period (7 Jun 2021 to 24 Sep 2026), net of costs charged on every position change.
Verdict
0 of 7 strategies beat buy & hold on Sharpe ratio
With hindsight, the best on the test period is Extra Trees at 0.53 against 0.68 for buy & hold. Drag the cost slider to see how quickly turnover erodes any edge.
Risk and return
Annualised with 252 trading days. Sharpe and Sortino assume a zero risk-free rate; Calmar = annual return รท max drawdown.
| Strategy | Total return | Annual return | Volatility | Sharpe | Sortino | Max drawdown | Calmar | Hit rate | Trades | Costs |
|---|---|---|---|---|---|---|---|---|---|---|
| Extra Trees | +58.1% | +9.1% | 16.3% | 0.53 | 0.76 | 27.7% | 0.33 | 50.2% | 89 | 17.80% |
| SVM (RBF) | +55.8% | +8.7% | 16.5% | 0.51 | 0.72 | 27.4% | 0.32 | 51.3% | 67 | 13.40% |
| Random Forest | +40.8% | +6.7% | 15.9% | 0.41 | 0.59 | 26.4% | 0.25 | 46.4% | 149 | 29.80% |
| Logistic Regression | +30.4% | +5.2% | 15.6% | 0.32 | 0.46 | 26.5% | 0.19 | 48.4% | 175 | 35.00% |
| Linear SVC | -12.7% | -2.5% | 14.9% | -0.17 | -0.24 | 30.3% | -0.08 | 43.6% | 333 | 66.60% |
| Gradient Boosting | -20.8% | -4.3% | 14.8% | -0.30 | -0.42 | 36.3% | -0.12 | 37.1% | 395 | 79.00% |
| Bagging (KNN) | -21.4% | -4.5% | 14.2% | -0.32 | -0.46 | 33.8% | -0.13 | 36.4% | 442 | 88.40% |
| Buy & hold | +82.8% | +12.1% | 16.7% | 0.68 | 0.98 | 25.4% | 0.48 | 53.5% | 1 | 0.20% |
Costs and risk
Would it survive real trading, and was the return worth the risk?
Takeaway With free trading, 5 of 7 strategies beat buy & hold on Sharpe; at 50 bp, none do. Extra Trees changed position 89 times in 1,332 trading days.
Takeaway Long/flat strategies sit in cash on predicted down days, so they take less risk than holding the stock. Compare returns per unit of volatility.
Inside one strategy
Change the model with the "Detail model" selector