Strategy backtest: Microsoft
Each model's prediction at today's close sets tomorrow's position (long or short). 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
2 of 7 strategies beat buy & hold on Sharpe ratio
With hindsight, the best on the test period is Extra Trees at 0.62 against 0.52 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 | +145.1% | +18.5% | 27.5% | 0.62 | 0.96 | 31.4% | 0.59 | 50.1% | 369 | 36.85% |
| Gradient Boosting | +116.6% | +15.7% | 27.6% | 0.53 | 0.80 | 37.3% | 0.42 | 49.1% | 562 | 56.15% |
| Bagging (KNN) | +51.2% | +8.1% | 27.5% | 0.28 | 0.43 | 36.7% | 0.22 | 49.1% | 603 | 60.25% |
| Logistic Regression | +24.7% | +4.3% | 27.6% | 0.15 | 0.23 | 41.7% | 0.10 | 49.5% | 485 | 48.45% |
| Random Forest | -2.6% | -0.5% | 27.6% | -0.02 | -0.03 | 54.8% | -0.01 | 49.5% | 548 | 54.75% |
| Linear SVC | -3.9% | -0.8% | 27.6% | -0.03 | -0.04 | 49.4% | -0.02 | 48.1% | 431 | 43.05% |
| SVM (RBF) | -48.0% | -11.6% | 27.6% | -0.45 | -0.63 | 65.7% | -0.18 | 48.6% | 508 | 50.75% |
| Buy & hold | +112.2% | +15.3% | 27.5% | 0.52 | 0.76 | 37.1% | 0.41 | 52.0% | 1 | 0.05% |
Costs and risk
Would it survive real trading, and was the return worth the risk?
Takeaway With free trading, 3 of 7 strategies beat buy & hold on Sharpe; at 50 bp, none do. Extra Trees changed position 369 times in 1,332 trading days.
Takeaway In long/short mode every strategy is always fully invested (long or short), so they all carry the stock's volatility. Only the return differs.
Inside one strategy
Change the model with the "Detail model" selector