- Strategy
- Buys when a bar closes back inside the lower Bollinger Band after the previous bar closed below it, and sells on the mirror setup at the upper band. The take-profit is the middle band.
- Risk model
- 1% of balance per trade (configurable), stop-loss beyond the excursion on every order, one position at a time
What it does
Bollinger Reversion EA looks for a stretch that has already started to fail. A single close outside a band is not enough: the EA waits for the next bar to close back inside the band, then trades back toward the middle band.
This re-entry rule filters out many of the moves that keep walking along the band during a strong trend, because those bars never close back inside.
How it works
The bands are a 20-period simple moving average (middle band) plus and minus 2 standard deviations of the close. On every new bar the EA checks the last two closed bars:
- Buy: the older bar closed below the lower band, and the last closed bar closed above the lower band but still below the middle band.
- Sell: the older bar closed above the upper band, and the last closed bar closed below the upper band but still above the middle band.
- Stop-loss: beyond the lowest low (buy) or highest high (sell) of the two bars, plus 0.5 × ATR(14).
- Take-profit: the middle band value on the signal bar.
Two safety checks follow. If the stop would be wider than 3 × ATR the setup is skipped, and if the middle band is closer than 0.7 × the stop distance the setup is skipped because the reward would be too small. The Bollinger Bands lesson explains the band calculation in more detail.
How to use it
Reversion to the middle band works best in sideways or gently trending markets. H1 is a sensible starting point for major pairs. Many traders run it only during the more liquid hours, which the trading-hours inputs allow. Confirm your lot sizes with the Lot Size Calculator before running it.
Settings
| Input | Default | What it changes |
|---|---|---|
| Bollinger period | 20 | Length of the middle band and deviation |
| Bollinger deviation | 2.0 | How far the bands sit from the middle |
| Stop buffer (x ATR) | 0.5 | Room beyond the excursion |
| Max stop (x ATR) | 3.0 | Skips very wide setups |
| Min reward vs stop | 0.7 | Skips setups with a close target |
| ATR period | 14 | Volatility used for stops and management |
| Risk per trade / Fixed lots | 1.0% / 0 | Position sizing |
| Max spread (points) | 30 | Spread filter |
| Trading start / end hour | 7 / 20 | Server-time window |
| Break-even / Trailing | on / off | Stop management |
Limitations
Breakouts that pause for one bar can still trigger a re-entry signal and then continue against the trade. The target is fixed at entry, while the live middle band keeps moving. On low timeframes the spread becomes a large share of the expected move. The rules contain no news filter, so scheduled releases can cause gaps through the stop.
Before you run it live
Test it in the Strategy Tester with realistic spreads, preferably on "every tick based on real ticks" data, and then on a demo account. Check that your broker's stop level is smaller than the stops the EA calculates, set the trading hours in server time, and keep risk per trade modest. Past behavior does not guarantee future results.

