# Freqtrade Bot Performance Analysis & Improvement Plan

**Date:** July 6, 2026
**Strategy:** SimpleStrategy (RSI crossover + EMA50 + BB%)
**Period:** April 24 - July 6, 2026 (dry-run on Kraken)

---

## 1. ACTUAL TRADE PERFORMANCE

### Trade Summary (32 trades, 30 closed)
| Metric | Value | Assessment |
|--------|-------|------------|
| Win rate | 76.9% (20W/6L) | Looks great on surface |
| Avg win | +2.30% | Modest gains |
| Avg loss | -16.57% | CATASTROPHIC |
| Loss/Win ratio | 7.2:1 | **Fatal flaw** |
| Total profit (closed) | +$48.08 | After fees, barely positive |

### The Devastation Timeline
**Phase 1: Old strategy (-22% stop loss) — 6 trades, ALL losses:**
- BTC: -$2.24 (Trade #4, -22.3%)
- ETH: -$22.40 (Trade #7, -22.3%)
- SOL: -$22.46 (Trade #8, -22.4%)
- XRP: -$22.55 (Trade #10, -22.5%)
- ADA: -$22.46 (Trade #11, -22.4%)
- ADA: -$22.41 (Trade #14, -22.4%)
- **Subtotal: -$114.52** — wiped out ALL previous +$14.30 in wins

**Phase 2: Fixed strategy (-6% stop) — 24 trades:**
- 20 wins averaging +2.3% = +$46.28
- 2 losses averaging -2.1% = -$4.18
- **Net: +$42.10**

**Key insight:** The strategy ITSELF is fine — the -22% stop was the killer.
After the fix, the strategy produces consistent +2-3% wins with tiny losses.

---

## 2. WHY THE BOT HAS BEEN IDLE SINCE JUNE 20

### Root cause: The RSI crossover condition is TOO restrictive

SimpleStrategy entry requires ALL three:
1. `RSI crosses ABOVE buy_rsi (30)` ← **THIS IS THE BOTTLENECK**
2. `Price > EMA50` (uptrend)
3. `BB% < 0.7` (not overbought)

**The RSI crossover problem:**
- `crossed_above(dataframe["rsi"], 30)` requires RSI to FIRST drop below 30
- Then cross back above 30
- In a stable/ranging market, RSI rarely drops below 30
- In a strong uptrend, RSI stays 40-60 (no crossover)
- In a strong downtrend, price < EMA50 blocks entry anyway

**Confirmed by backtest:** The June 16 backtest on BTC/USD produced 0 trades over 40 days.
The strategy literally generates NO signals in the current market regime.

### Market regime analysis
The strategy is a MEAN-REVERSION strategy (buy the dip). It only works when:
- There are clear pullbacks (RSI drops below 30)
- Within an overall uptrend (price > EMA50)

In sideways or strongly trending markets, it sits idle.

---

## 3. SPECIFIC IMPROVEMENTS

### 3.1 Fix: Multi-regime entry signals (RECOMMENDED)

Instead of a single restrictive entry, add multiple entry patterns:
- **Signal A (original):** RSI oversold crossover (for pullbacks)
- **Signal B (momentum):** EMA crossover + volume (for breakouts)
- **Signal C (pullback):** RSI < 40 + price near EMA20 (for dips in trends)

This dramatically increases signal frequency while keeping risk controlled.

### 3.2 Fix: Market regime detection

Add an adaptive stoploss that tightens in choppy markets:
- High ADX (>25): Use normal -6% stop (trending)
- Low ADX (<15): Use tighter -4% stop (choppy)
- RSI range > 50: Market is volatile, use wider stops

### 3.3 Risk management improvements

**Current problem:** Even with -6% stop, the risk/reward is 1:0.5
(Avg loss -6% vs avg win +2.3%). You need to either:
- Increase average win size (let winners run longer)
- Decrease average loss size (tighter stops + faster exits)

**Recommendations:**
1. Lower stoploss to -4% (from -6%)
2. Add ATR-based dynamic stop: `stop = max(-0.04, -2 * ATR / close)`
3. Partial exit at +3% (from +4%) to lock in more profits faster
4. Max 2% portfolio risk per trade (adjust stake based on stop distance)

### 3.4 Config improvements

| Setting | Current | Recommended | Why |
|---------|---------|-------------|-----|
| stake_amount | $100 | $50-75 | Lower per-trade risk, more trades |
| max_open_trades | 5 | 3-4 | Avoid overconcentration |
| timeframe | 5m | Keep 5m OR add 15m | 5m is fine, but 15m gives cleaner signals |
| pair_whitelist | 5 pairs | Add AVAX, DOGE, LINK | More opportunities, better diversification |
| pairlists | StaticPairList | Static + Performance filter | Auto-drop worst performers |

### 3.5 Strategy comparison

| Strategy | Signal Type | Signal Frequency | Risk/Reward | Best For |
|----------|-------------|-----------------|-------------|----------|
| SimpleStrategy | RSI crossover | LOW | 1:0.5 | Pullbacks in uptrends |
| TrendPullbackStrategy | RSI pullback + EMA200 | MEDIUM | 1:0.6 | Uptrend pullbacks |
| TrendRideStrategy | EMA crossover | MEDIUM-HIGH | 1:0.8 | Strong trends |
| TrendMomentumStrategy | EMA50 bounce | LOW-MEDIUM | 1:0.5 | Trend continuation |
| EMAPullbackStrategy | RSI + MACD | MEDIUM | 1:0.6 | Mixed regimes |

**Recommendation:** The TrendPullbackStrategy is the closest to SimpleStrategy
but with better signal generation (RSI < threshold + recovery, not crossover).
I recommend building an improved hybrid strategy combining the best elements.

---

## 4. BACKTESTING PLAN

### Phase 1: Validate improved strategy
```bash
# Download 6 months of data for all pairs
freqtrade download-data --exchange kraken --pairs BTC/USD ETH/USD SOL/USD XRP/USD ADA/USD AVAX/USD DOGE/USD --timeframes 5m 15m --days 180

# Backtest improved strategy
freqtrade backtesting --strategy ImprovedStrategy --config config.json --timerange 20260101-20260706 --timeframe 5m

# Compare against SimpleStrategy
freqtrade backtesting --strategy SimpleStrategy --config config.json --timerange 20260101-20260706 --timeframe 5m
```

### Phase 2: Hyperopt (if GPU available)
```bash
# Optimize entry parameters
freqtrade hyperopt --strategy ImprovedStrategy --config config.json --timerange 20260101-20260501 --spaces buy sell --epochs 1000

# Validate on held-out period
freqtrade backtesting --strategy ImprovedStrategy --config config.json --timerange 20260501-20260706 --timeframe 5m
```

### Phase 3: Dry-run comparison (parallel)
Run both SimpleStrategy and ImprovedStrategy in dry-run mode for 2 weeks
to compare real-world performance before switching.

---

## 5. DRY-RUN TO LIVE TRADING PLAN

### Pre-requisites checklist:
- [ ] Strategy shows positive PnL in backtest over 3+ months
- [ ] Strategy shows positive PnL in 2+ weeks of dry-run
- [ ] Max drawdown in dry-run < 10%
- [ ] Win rate > 60% AND average win > 1.5x average loss
- [ ] API keys rotated (current ones are in plaintext in config!)
- [ ] Stop loss verified to execute correctly on exchange

### Step 1: Extended dry-run with improved strategy (2-4 weeks)
- Start with $1000 virtual balance
- Track daily PnL, compare to buy-and-hold

### Step 2: Micro live trading (2-4 weeks)
- Stake: $10-25 per trade (1-2% of intended portfolio)
- Same strategy, same parameters
- Verify stop losses execute correctly
- Monitor for slippage vs dry-run

### Step 3: Scale up
- Increase stake to $50-100 per trade
- Monitor for 1-2 weeks
- If stable, scale to full intended position size

### Step 4: Full deployment
- Use full stake amount
- Enable protections (max drawdown circuit breaker)
- Monitor daily, adjust parameters if needed

---

## 6. CRITICAL SECURITY ISSUE

**The config.json contains plaintext API keys!**
```json
"key": "stNFONPNMrmHmUE1zPKfKEIzAlq6I38CehSXhwewqM5e0MjEJq2IGO8Vpj4OfAiM"
"secret": "da6Wu8XJUBrzPggCCCtXspUJKIlXA8ORq4LLpvtwd0KGbRkVqKjN3GGLC1wlCmj2"
```

**Action required IMMEDIATELY:**
1. Revoke current API keys on Kraken
2. Generate new API keys
3. Use environment variables or freqtrade's `--db-url` and credential management
4. Add config.json to .gitignore
5. Consider using freqtrade's built-in credential management

Also: The API server JWT secret ("somethingRandomSomethingRandom123") and
password ("2ppq6VRS7") are weak. Update these to strong random values.
