Skip to main content

Bollinger Band Reversal EA Template for MetaTrader 5

The Bollinger Band reversal is one of the most reliable mean reversion strategies in forex trading. This free EA template enters when price touches the upper or lower Bollinger Band and targets a return to the mean. It uses BB(20,2) with ATR-based risk management, optimized for the London session. Build it in AlgoStudio without coding, customize the parameters, and export a production-ready MQL5 Expert Advisor in minutes.

What Is a Bollinger Band Reversal Strategy?

A Bollinger Band reversal strategy uses Bollinger Bands to identify when price has moved too far from its average and is likely to snap back. Bollinger Bands consist of three lines: a middle band (a simple moving average, typically 20 periods) and an upper and lower band placed 2 standard deviations away. When price touches or pierces the outer bands, it is statistically extended and more likely to revert toward the middle.

This is a mean reversion approach \u2014 it assumes that extreme price moves are temporary and that price will return to its average. The trade-off is a moderate win rate (45\u201355%) with smaller individual winners, because you are targeting the middle band rather than riding a trend. The strategy is profitable when applied to range-bound markets where price regularly oscillates between the bands.

Bollinger Bands automatically adapt to market volatility. In volatile markets, the bands widen, requiring a larger move to trigger a signal. In calm markets, the bands narrow, capturing smaller mean reversion moves. This self-adjusting behavior makes the strategy robust across different market conditions without constant parameter tuning.

How This EA Template Works

BUY SIGNAL: Price touches or closes below the lower Bollinger Band during the London session
SELL SIGNAL: Price touches or closes above the upper Bollinger Band during the London session
EXIT: Stop loss at 1.5x ATR(14) or take profit at 2:1 risk-reward ratio

The London session filter (08:00\u201317:00 GMT) ensures you trade during the most liquid hours when spreads are tightest and mean reversion patterns are most reliable. ATR-based stop losses adapt to current volatility \u2014 wider stops when the market is volatile, tighter stops in calm conditions.

The strategy performs best in range-bound and consolidating markets where price regularly bounces between the bands. It underperforms during strong trending moves where price can ride along the upper or lower band for extended periods. Adding an ADX filter (only trade when ADX < 25, confirming no strong trend) is a common improvement to avoid these “band walking” periods.

Default Parameters

These defaults work well on range-bound pairs (EURGBP, AUDNZD) on H1. All parameters are exported as input variables so you can optimize them in the MT5 Strategy Tester.

ParameterValueType
BB Period20Bollinger Band
BB Deviation2.0Bollinger Band
Stop Loss1.5x ATR(14)ATR-based
Take Profit2:1 R:RRisk-reward
SessionLondon (08:00–17:00 GMT)Timing
Max Trades/Day3Risk
Position Sizing1% risk per tradeRisk

How to Build This EA Without Coding

1. Create a new project in AlgoStudio

Sign up for free (no credit card required) and click “New Project”. Name your project “BB Reversal Strategy” and open the visual builder canvas.

2. Add timing and indicator blocks

Drag a Trading Sessions block onto the canvas and select the London session (08:00\u201317:00 GMT). Add a Bollinger Bands block \u2014 set the period to 20 and deviation to 2.0. Connect it to the timing block. The BB block provides upper band, lower band, and middle band values automatically.

3. Add trade execution and risk management

Add Place Buy and Place Sell blocks. Connect a “Price crosses below Lower Band” condition to the Buy block, and “Price crosses above Upper Band” to the Sell block. Add Stop Loss (set to 1.5x ATR with period 14), Take Profit (set to 2:1 risk-reward ratio), position sizing (1% risk per trade), and Max Trades Per Day (3).

4. Export, backtest, and optimize

Click Export to generate a .mq5 file. Load it into MetaTrader 5 and backtest on EURGBP H1 with at least 2 years of historical data. Use the MT5 Strategy Tester optimizer to find the best BB settings \u2014 try periods from 15\u201330 and deviations from 1.5\u20132.5. Demo trade for 1\u20133 months before going live.

Optimization Tips

Test different deviation levels

The standard 2.0 deviation is a solid default, but 1.5 and 2.5 are worth testing. Lower deviation (1.5) generates more frequent signals with a lower win rate per trade. Higher deviation (2.5) triggers less often but each signal is more reliable because price is genuinely overextended. Match the deviation to your risk tolerance.

Add an ADX filter to avoid trends

The biggest risk for mean reversion strategies is entering against a strong trend. Adding an ADX block with a threshold below 25 ensures you only take trades when the market is range-bound. This filters out “band walking” scenarios where price rides along the upper or lower band during strong trends.

Consider the middle band as a profit target

Instead of a fixed risk-reward ratio, you can target the middle Bollinger Band (the 20 SMA) as your take profit level. This is the natural mean reversion target and often produces a higher win rate. Test both approaches in backtesting to see which gives better risk-adjusted returns on your chosen pair.

Frequently Asked Questions

What timeframe works best for the Bollinger Band reversal strategy?
H1 (1-hour) and H4 (4-hour) timeframes produce the most reliable mean reversion signals. On lower timeframes like M15, price touches the bands too frequently and many signals are noise. H4 gives fewer but higher-quality touches where price is genuinely extended. Start with H1 and move to H4 if you want fewer, cleaner trades.
Which currency pairs work best for Bollinger Band mean reversion?
Range-bound pairs like EURGBP, AUDNZD, and EURCHF work best because they naturally oscillate between support and resistance levels. Avoid strongly trending pairs like USDJPY during trend phases. The strategy profits from price returning to the mean, so pairs that consolidate more than they trend are ideal.
What is the expected win rate for this strategy?
A well-optimized Bollinger Band reversal strategy typically wins 45-55% of trades. The wins tend to be smaller than with trend-following strategies because you are targeting a return to the middle band, not riding a long move. Profitability comes from a consistent edge over many trades rather than large individual winners.
Should I use the standard 20-period, 2-deviation Bollinger Band settings?
The 20-period with 2 standard deviations is the most widely used default and a strong starting point. A wider deviation (2.5) gives fewer but more reliable signals because price has to be more extended. A tighter deviation (1.5) gives more signals but more false entries. Test 2.0 first, then try 1.5 and 2.5 in the Strategy Tester.
Can I combine Bollinger Bands with other indicators?
Yes. Adding an RSI filter is a common improvement — only buy when price touches the lower band AND RSI is below 30, confirming oversold conditions. A volume filter can also help by requiring above-average volume on the band touch. Keep total indicators to 2-3 to avoid overfitting.

Build the BB Reversal EA in minutes

Create this strategy with AlgoStudio's visual builder. Free plan available \u2014 no credit card required.

Start Validating — Free

Risk Warning: Trading in financial markets involves substantial risk of loss and is not suitable for every investor. Past performance does not guarantee future results. Always test strategies on a demo account first. AlgoStudio is a strategy validation platform — it does not provide financial advice or guarantee profits. See our Terms of Service for full details.