Bollinger Bands N positions
This EA trades Bollinger Bands mean reversion signals by opening positions when price touches or exceeds the upper or lower band, expecting a return to the mean. It supports opening multiple (N) concurrent positions in the same direction as price deviates further from the bands, scaling into the move. Exits are triggered when price returns to the middle band or by configurable 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 | -4.00% | -3.48% | 6.04% | 84 | 55.40% | -0.81 | -0.66 | 4 | −$4.90 | Reliable |
| GBPUSD | -4.76% | -4.15% | 6.50% | 84 | 57.80% | -0.69 | -0.73 | 3 | −$5.38 | Reliable |
| USDJPY | -5.08% | -4.43% | 8.42% | 120 | 57.10% | -0.82 | -0.60 | 5 | −$4.32 | Reliable |
| XAUUSD | +45.17% | +36.06% | 76.32% | 79 | 62.80% | 0.97 | 0.59 | 3 | +$54.75 | Reliable |
Profitable on 1 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 27% of 30 · GBPUSD: better than 22% of 32 · USDJPY: better than 9% of 32 · XAUUSD: better than 68% of 31
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 46% | +3.33% 2026-03 | -3.76% 2026-01 |
| GBPUSD | 46% | +2.37% 2026-05 | -2.58% 2026-01 |
| USDJPY | 38% | +1.81% 2026-05 | -2.18% 2026-01 |
| XAUUSD | 54% | +121.95% 2026-02 | -41.65% 2026-01 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: No blow-up pattern found
- Has no stop loss or trailing stop
On its own this is not a typical blow-up pattern, 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
This EA employs a classic Bollinger Bands mean reversion strategy, with the core logic being that price tends to revert to the middle band (moving average) after deviating beyond the upper or lower bands. Entry conditions trigger a sell when price touches or exceeds the upper band and a buy when price touches or falls below the lower band, with support for N positions that scale in as price deviates further, reinforcing the mean reversion thesis but increasing risk exposure. Exit conditions primarily rely on price returning to the middle band for closure, with stop loss and take profit levels as protective fallbacks. Position sizing uses fixed or configurable lot sizes, and the N-position scaling mechanism amplifies profit potential but significantly increases risk. Money management lacks dynamic control over total exposure, and stacked positions during sustained trending moves could lead to substantial drawdowns.
Strengths
- Bollinger Bands is a well-established mean reversion indicator with clear and understandable logic
- Multi-position scaling can enhance returns in ranging/choppy markets
- Middle band reversion exit is logically sound and consistent with mean reversion principles
Weaknesses
- Stacked positions pose extreme risk in trending markets, potentially causing severe losses
- Lacks dynamic money management and total exposure control mechanisms
- No new bar check may cause repeated entries within the same candle
- No spread filter may lead to poor entries near band boundaries due to slippage
Possible improvements
- Add total exposure limits and dynamic position sizing based on account equity percentage
- Implement a trend filter (e.g., higher timeframe MA direction) to prevent counter-trend scaling during strong trends
Risk assessment
Overall risk: Caution
- Multiple counter-trend positions can accumulate massive floating losses during sustained trends
- Default stop loss of 0 means no protective stop, relying on mean reversion that may fail
- Lack of spread filter and new bar check increases overtrading risk
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
BB_Period | 20 | Bollinger Bands calculation period |
BB_Deviation | 2.0 | Bollinger Bands standard deviation multiplier |
N_Positions | 3 | Maximum positions in same direction |
LotSize | 0.1 | Lot size per trade |
StopLoss | 0 | stop losspoints (0meansno) |
TakeProfit | 0 | take profitpoints (0meansno) |
MagicNumber | 18311 | EA magic number for order identification |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.