RSI and Bollinger Bands
This EA combines RSI and Bollinger Bands indicators to identify overbought and oversold market conditions for mean reversion trading. It enters buy trades when RSI is oversold and price touches the lower Bollinger Band, and sell trades when RSI is overbought and price touches the upper Bollinger Band. The strategy targets price reversals back to the Bollinger Band middle line or uses fixed take-profit and stop-loss levels for exits.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | -3.24% | -2.82% | 8.82% | 1 | 0.00% | — | — | — | — | Too few trades |
| GBPUSD | +2.78% | +2.41% | 6.56% | 1 | 0.00% | — | — | — | — | Too few trades |
| USDJPY | -2.41% | -2.10% | 7.53% | 1 | 0.00% | — | — | — | — | Too few trades |
| XAUUSD | -91.61% | -87.09% | 94.00% | 2 | 0.00% | -0.45 | -0.97 | 2 | −$4,580.37 | Account stopped out |
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Against the other Mean Reversion EAs with a reliable result on the same market: XAUUSD: better than 13% of 31
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| XAUUSD | 0% | 0.00% 2026-02 | -85.62% 2026-01 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- Hit a stop-out in our backtest (equity below 10%) on XAUUSD
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
This strategy is a classic mean reversion system that uses Bollinger Bands to measure statistical price deviation while confirming momentum extremes with RSI. Entry conditions require price to touch or pierce the lower Bollinger Band with RSI in oversold territory (typically below 30) for buy signals, and price to touch or exceed the upper Bollinger Band with RSI in overbought territory (typically above 70) for sell signals, with the dual-condition filter improving signal quality. Exit conditions include fixed take-profit and stop-loss levels as well as a close-when-price-returns-to-middle-band logic. Position sizing typically uses either fixed lot sizes or balance-proportional calculations. Money management relies on the statistical assumption that price will revert to the mean within the Bollinger Band envelope, but consecutive losses can accumulate during strong trending markets where the mean reversion assumption fails. The overall strategy logic is clear and well-structured, but risk exposure control during extreme market conditions is insufficient without a secondary trend-state filter.
Strengths
- Dual-indicator confirmation filter reduces false signals and improves entry quality
- Bollinger Bands provide natural statistical boundaries serving as support/resistance references
- Strategy logic is simple and clear, easy to understand and optimize
- Mean reversion logic performs robustly in ranging markets
- Highly tunable parameters adapt to different instruments and timeframes
Weaknesses
- Mean reversion assumption fails in strong trending markets, potentially leading to consecutive losses
- Lacks a trend-state filter mechanism, cannot distinguish between ranging and trending markets
- Fixed lot position sizing ignores volatility changes, leading to uneven risk exposure
- Bollinger Bands may be too narrow during low volatility, generating frequent false signals
- Missing new bar check may cause repeated entries on the same candle
Possible improvements
- Add a trend filter (e.g., ADX or higher-timeframe MA) to pause trading or reverse logic during trending markets
- Introduce ATR-based dynamic stop-loss, take-profit, and position sizing to match risk exposure with volatility
Risk assessment
Overall risk: Medium
- Lacks trend-state identification, may consecutively open counter-trend positions during one-sided markets causing severe losses
- Missing new bar check mechanism, may repeatedly open positions on the same candle amplifying risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
RSI_Period | 14 | RSI indicator period |
RSI_Overbought | 70 | RSI overbought threshold |
RSI_Oversold | 30 | RSI oversold threshold |
BB_Period | 20 | Bollinger Bands period |
BB_Deviation | 2.0 | Bollinger Bands standard deviation multiplier |
LotSize | 0.1 | Fixed trading lot size |
StopLoss | 0 | stop losspoints (0=disable) |
TakeProfit | 0 | take profitpoints (0=disable) |
MagicNumber | 123456 | EA magic number identifier |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.