Introduction
Bollinger Bands are one of the most powerful tools in the algorithmic trader's arsenal. When price compresses and then bursts outside the bands, it signals an extreme — a moment that historically reverts back toward the mean. On LMEX perpetual futures, where volatility spikes frequently, this creates consistent opportunities for mean-reversion traders.
What Are Bollinger Bands?
Developed by John Bollinger in the 1980s, Bollinger Bands consist of three lines plotted around a moving average:
- Middle Band: A 20-period Simple Moving Average (SMA) of closing prices
- Upper Band: Middle band + 2 standard deviations
- Lower Band: Middle band − 2 standard deviations
The key insight: roughly 95% of price action should fall within the bands. When price breaches them, statistical theory suggests reversion is more likely than continuation.
The Reversion Strategy on LMEX
The Bollinger Band Reversion strategy on LMEX works as follows:
Entry Rules:
- Price touches or closes below the lower band → Long entry (expecting reversion upward)
- Price touches or closes above the upper band → Short entry (expecting reversion downward)
Exit Rules:
- Close the position when price returns to the middle band (20-period SMA)
- Stop loss: if price continues beyond the band by more than 1 standard deviation
This asymmetry — entering at extremes, exiting at the mean — gives the strategy a natural risk-reward edge in ranging and mildly trending markets.
Python Implementation for LMEX
Here is the core signal logic for BTC-PERP on the 1-hour chart:
import pandas as pddef calculate_bollinger_bands(df, period=20, std=2.0):
mid = df["close"].rolling(period).mean()
sigma = df["close"].rolling(period).std()
upper = mid + std * sigma
lower = mid - std * sigma
return upper, mid, lower
def get_signal(df):
upper, mid, lower = calculate_bollinger_bands(df)
price = df["close"].iloc[-1]
if price <= lower.iloc[-1]:
return "LONG" # price at lower band — buy
elif price >= upper.iloc[-1]:
return "SHORT" # price at upper band — sell
elif price >= mid.iloc[-1]:
return "EXIT_LONG"
elif price <= mid.iloc[-1]:
return "EXIT_SHORT"
return "HOLD"
Optimising Parameters for LMEX Markets
The default 20-period, 2-standard-deviation configuration works well on BTC-PERP and ETH-PERP on 1-hour and 4-hour charts. However, tuning matters:
Period (20): Shorter periods (10-15) create more signals but more false positives. Longer periods (30-50) filter noise but reduce trade frequency. For crypto's 24/7 markets, 20 on the 1h chart typically provides 3-6 signals per week on BTC-PERP.
Standard Deviation (2.0): The classic setting. Using 2.5 or 3.0 means entering only at more extreme moves — fewer trades, higher win rate. Using 1.5 means entering earlier, more trades but more noise.
Timeframe: The 1-hour chart balances signal quality with frequency. On 15-minute charts the strategy generates more trades but requires tighter risk management.
Risk Management Rules
Bollinger Band Reversion is powerful but not risk-free. Markets can trend hard against you at the bands:
- Stop loss: Place at 1.5× the band width beyond entry. If you long at the lower band, stop below lower − 0.5× bandwidth
- Position size: Risk maximum 2% of account per trade
- Market regime filter: Only take long signals when BTC 4h trend is neutral or bullish. Avoid shorting into strong bull moves
- Max concurrent positions: Run only one position at a time on a single symbol
When It Fails
The strategy underperforms in strong trending markets. A parabolic BTC rally will break through the upper band repeatedly without reverting — each short becomes a loss. Add a simple trend filter: if price is more than 3% above the 50-period MA, skip short signals. If price is more than 3% below, skip long signals.
Key Takeaways
- Bollinger Band Reversion enters at statistical extremes (band touches) and exits at the mean (middle band)
- Works best on LMEX BTC-PERP and ETH-PERP on 1h–4h charts in ranging markets
- Default settings: 20-period SMA, 2.0 standard deviations
- Always combine with a stop loss — extremes can extend further before reverting
- Add a trend filter to avoid fading strong directional moves