RSI Bollinger Bands EA
This EA combines RSI and Bollinger Bands to identify mean reversion trading opportunities. It enters long positions when RSI is oversold and price touches the lower Bollinger Band, and enters short positions when RSI is overbought and price touches the upper Bollinger Band. Exits are triggered when price reverts to the Bollinger Band middle line or by stop loss/take profit levels.
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 | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Run error |
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.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
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
The strategy concept is based on mean reversion principles, using Bollinger Bands to measure price deviation and RSI to confirm overbought/oversold conditions as an auxiliary filter. Entry conditions for longs require price touching or breaking below the lower Bollinger Band with RSI below the oversold threshold; for shorts, price touching or breaking above the upper Bollinger Band with RSI above the overbought threshold. Exit conditions include closing positions when price reverts to the Bollinger Band middle line, as well as preset stop loss and take profit levels. Position sizing uses a fixed lot approach without dynamic lot adjustment mechanisms. Money management lacks dynamic calculation based on account balance or risk percentage, relying solely on fixed lots and stop loss/take profit to control risk. The overall strategy logic is clear but lacks a trend environment filter, which may lead to frequent counter-trend trades and consecutive losses during strong trending markets.
Strengths
- Dual indicator filtering reduces false signals, RSI combined with Bollinger Bands improves entry quality
- Mean reversion strategy performs steadily in ranging markets with clear and understandable logic
- Stop loss and take profit mechanisms provide basic risk control
Weaknesses
- Lacks trend filtering mechanism, prone to consecutive counter-trend losses in strong trending markets
- Fixed lot position sizing does not consider account risk ratio and cannot dynamically adjust based on market volatility
- Missing new bar check mechanism, may repeatedly open positions on the same bar
Possible improvements
- Add a trend filter indicator (e.g., moving average direction or ADX) to allow mean reversion trades only in the direction of the broader trend
- Implement dynamic position sizing based on account risk percentage, adjusting stop loss distance and lot size according to ATR
Risk assessment
Overall risk: Medium
- Missing new bar check may cause repeated position opening on the same bar, increasing risk exposure
- Mean reversion strategy carries significant risk of counter-trend trading during strong trending markets
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
RSI_Period | 14 | RSI calculation period |
RSI_Overbought | 70 | RSI overbought threshold |
RSI_Oversold | 30 | RSI oversold threshold |
BB_Period | 20 | Bollinger Bands calculation period |
BB_Deviation | 2.0 | Bollinger Bands standard deviation multiplier |
LotSize | 0.1 | Fixed trading lot size |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Take profit in points |
MagicNumber | 123456 | EA magic number identifier |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.