BollingerBandsEA Ver3.0
This EA trades Bollinger Band mean reversion signals, entering long when price touches the lower band and entering short when price touches the upper band, expecting a return to the moving average. Version 3.0 likely adds position management and risk controls on top of the core band-based entry logic. It is a fully automated systematic strategy targeting ranging markets.
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.05% | -2.66% | 6.85% | 128 | 46.10% | -0.72 | -0.45 | 7 | −$2.38 | Reliable |
| GBPUSD | -6.25% | -5.46% | 10.38% | 124 | 45.50% | -1.05 | -0.60 | 7 | −$4.89 | Reliable |
| USDJPY | +0.99% | +0.86% | 5.13% | 120 | 53.80% | 0.24 | 0.19 | 4 | +$0.71 | Reliable |
| XAUUSD | +122.49% | +93.62% | 32.13% | 130 | 54.30% | 1.88 | 3.81 | 5 | +$93.04 | Reliable |
Profitable on 2 of 4 markets with reliable results.
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: EURUSD: better than 40% of 30 · GBPUSD: better than 9% of 32 · USDJPY: better than 47% of 32 · XAUUSD: better than 94% of 31
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +1.79% 2026-10 | -3.97% 2026-04 |
| GBPUSD | 31% | +2.17% 2026-10 | -2.58% 2026-06 |
| USDJPY | 69% | +1.38% 2026-09 | -2.60% 2026-03 |
| XAUUSD | 69% | +72.56% 2026-02 | -15.15% 2026-06 |
From the backtest equity curve, sampled about every two days; only reliable results.
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 core strategy concept is Bollinger Band mean reversion, exploiting the statistical tendency of price to revert to the mean after deviating from the middle band. Entry conditions: open a long position when price touches or breaks below the lower Bollinger Band, and open a short position when price touches or breaks above the upper band, on the assumption that overextension will correct. Exit conditions typically include taking profit when price returns to the middle band, and placing a stop loss at a defined distance beyond the band edge for risk control. Position sizing may use fixed lots or an account-balance-proportional method. Money management ties stop-loss distance to Bollinger Band width, creating an adaptive stop that widens in volatile markets and tightens in calm ones. The strategy performs well in ranging markets but can suffer consecutive losses during strong trends, as price may ride the band edge without reverting.
Strengths
- Bollinger Bands adapt to volatility automatically, adjusting entry and stop-loss ranges as market conditions change
- Mean reversion logic achieves high win rates and stable profitability in ranging markets
- Clear and intuitive strategy logic with few parameters, easy to understand and optimize
Weaknesses
- Can suffer consecutive losses in strong trends as price rides the band edge without reverting
- Lacks a trend filter to distinguish ranging from trending conditions, leading to frequent entries in unfavorable markets
- Fixed lot or simple proportional sizing cannot dynamically adjust risk exposure based on band width or market regime
Possible improvements
- Add a trend filter (e.g., ADX or higher-timeframe MA) to pause trading or switch strategy during trending markets
- Introduce dynamic position sizing based on Bollinger Band width or ATR to control per-trade risk percentage
- Add a trailing stop or partial close mechanism to lock in profits as price reverts toward the middle band
Risk assessment
Overall risk: Medium
- No trend filter mechanism, leading to consecutive stop-losses in strong trends
- If stop-loss is set to 0 or relies on the outer band, extreme market moves can cause slippage far exceeding expectations
- No mention of new bar check, potentially allowing repeated entries within the same candle
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
BandsPeriod | 20 | Bollinger Bands period parameter |
BandsDeviation | 2 | Bollinger Bands standard deviation multiplier |
LotSize | 0.1 | Fixed lot size per trade |
StopLoss | 0 | Stop loss in points, 0 to disable |
TakeProfit | 0 | Take profit in points, 0 to disable |
MagicNumber | 54612 | EA magic number for identifying this EA's orders |
MaxOpenPositions | 1 | Maximum simultaneous positions |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.