# 📊 CRYPTO BACKTEST RESULTS - BTC/USDT 2024-2025

## ⚔️ Backtest Engine by Gandalf 🧙‍♂️

**Data:** BTC/USDT | Binance | 1h candles  
**Period:** 2024-01-01 → 2025-03-01 (10,201 candles)  
**Initial Capital:** $10,000  
**Commission:** 0.1%

---

## 🏆 STRATEGY RANKING

| Rank | Strategy | Return | Win Rate | Sharpe | Max DD | Trades |
|------|----------|--------|----------|--------|--------|--------|
| 🥇 1 | **Volume Spike** | **+91.8%** | 100% | 0.93 | 0.0% | 1 |
| 🥈 2 | EMA Crossover | -14.7% | 30% | -0.05 | -29.6% | 462 |
| 🥉 3 | Momentum Breakout | -34.4% | 34% | -0.42 | -50.1% | 186 |
| 4 | Mean Reversion | -35.2% | 64% | -0.43 | -65.2% | 243 |

---

## 📈 STRATEGY DETAILS

### 1. Volume Spike (+91.8%) ✅ BEST
- **Logic:** Volume > 2x 20-period average → LONG
- **Result:** Only 1 trade in the entire period (March 2024 volume surge)
- **Verdict:** Lucky timing, not repeatable. Needs filters.

### 2. EMA Crossover (-14.7%)
- **Logic:** EMA 9 crosses EMA 21 → signal
- **Result:** 462 trades, but 70% losing trades
- **Verdict:** Classic whipsaw in sideways market. Needs trend filter.

### 3. Momentum Breakout (-34.4%)
- **Logic:** Price breaks 24h high → LONG, breaks 24h low → SHORT
- **Result:** 186 trades, heavy drawdowns
- **Verdict:** Works in trending markets, destroyed in consolidation.

### 4. Mean Reversion / RSI (-35.2%)
- **Logic:** RSI < 30 → LONG, RSI > 70 → SHORT
- **Result:** Highest win rate (64%) but large single losses
- **Verdict:** BTC doesn't mean-revert well. Losses exceed wins.

---

## 📉 KEY INSIGHTS

1. **BTC 2024-2025 was a rough period for naive strategies** - Most simple strategies lost money
2. **Volume Spike had only 1 trade** - Statistically meaningless but captured a big move
3. **Win rate ≠ Profit** - Mean Reversion had best win rate (64%) but still lost because losers were huge
4. **Sharpe ratios all negative (except Volume Spike)** - Risk-adjusted returns were poor
5. **Max drawdowns were brutal** - Even EMA had -29%, others reached -50% to -65%

---

## 📁 FILES GENERATED

- `backtest_engine.py` - Full backtest engine (run with `.venv/bin/python3 backtest_engine.py`)
- `btc_ohlcv_2024_2025.csv` - Raw OHLCV data (10,201 candles)
- `backtest_summary.csv` - Results table
- `trades_*.csv` - Trade logs per strategy
- `backtest_results.png` - Charts

---

## 🔧 HOW TO USE

```bash
cd /home/node/.openclaw/workspace/crypto-wallet
.venv/bin/python3 backtest/backtest_engine.py
```

---

## ⚠️ DISCLAIMER

Backtest results are NOT indicative of future performance. 
Markets in 2024-2025 were affected by unique conditions (post-halving, ETF inflows, etc.)
Always do forward testing before live trading.
