An Expert Advisor (EA) is different from every other download on this site — an indicator only plots or alerts, while an EA actually sends orders on your behalf. This free EA trades a mean-reversion strategy that only fires on confluence: it never trades off a single signal, and instead waits for two independent readings — a Bollinger Band touch and an RSI extreme — to agree before it risks a single pip of your account.
How the Strategy Works
The first leg of the signal is a Bollinger Bands touch — price closing at or below the lower band (default 20-period, 2.0 deviation) for a potential BUY, or at or above the upper band for a potential SELL. On its own, a band touch simply means price has moved an unusual distance from its recent average; it does not tell you whether that move is exhausted or about to accelerate further, because a strong trending move can ride the band for many bars in a row without ever reversing.
That is exactly why this EA requires a second, independent signal before it acts: RSI (default 14-period) must simultaneously be below the Oversold level (default 30) for a BUY, or above the Overbought level (default 70) for a SELL. RSI measures the speed and change of recent price moves, so a reading in oversold or overbought territory suggests the move that pushed price to the band has also exhausted its own momentum — the two indicators are measuring different things (distance from average vs. speed of the move), and when they agree, the case for a reversal is meaningfully stronger than either reading alone. A band touch without momentum exhaustion is very often a strong trend continuing right through the band, not a reversal — this EA is built specifically to avoid taking that trade.
Stop Loss, Take Profit, and Position Sizing
Stop Loss is sized from ATR rather than a fixed pip distance — SL distance = ATR × ATRMultiplier (default 2.0) — so a volatile pair or session automatically gets a wider stop, and a calm one gets a tighter stop, rather than the EA using the same fixed distance regardless of current volatility. Take Profit is then set as a multiple of that Stop Loss distance: TP distance = SL distance × RiskRewardRatio (default 2.0), keeping every trade's risk and reward in a fixed, known proportion no matter how wide or narrow the ATR-based stop happens to be on a given entry.
Position size is calculated using the exact worked-example method from Risk Management Basics: the amount you're willing to risk (RiskPercent, default 1.0%, of account balance) divided by the Stop Loss distance gives the lot size. This means the EA automatically trades smaller when the stop is wide and larger when the stop is tight, rather than risking a wildly different dollar amount from trade to trade. A UseFixedLot input is available as an escape hatch for traders who'd rather set a constant lot size (FixedLotSize) and ignore the risk-based calculation entirely.
Entry Conditions
- BUY — price closes at or below the lower Bollinger Band and RSI is below the Oversold level, both true at the same time.
- SELL — price closes at or above the upper Bollinger Band and RSI is above the Overbought level, both true at the same time.
The EA only evaluates these conditions once per new bar (not on every tick), so the same confluence signal can't fire repeatedly within a single candle. It only opens one position at a time, and it only manages positions tagged with its own magic number (20260720) — so it won't interfere with trades you open manually on the same account, and it won't stack a second trade on top of one that's already open. A MaxSpreadPoints filter (default 30) also blocks new entries whenever the current spread is wider than that threshold, so the EA doesn't open trades at a poor price during illiquid conditions.
Parameters
- BandsPeriod (default 20) — the Bollinger Bands moving-average period used to calculate the middle, upper, and lower bands.
- BandsDeviation (default 2.0) — how many standard deviations the upper and lower bands sit from the middle band; wider deviation means fewer, more extreme touches.
- RSIPeriod (default 14) — the lookback period for the RSI confirmation reading.
- RSIOversold (default 30) — the RSI level that must be undercut for a BUY confluence.
- RSIOverbought (default 70) — the RSI level that must be exceeded for a SELL confluence.
- ATRPeriod (default 14) — the lookback period used to calculate ATR for the Stop Loss distance.
- ATRMultiplier (default 2.0) — Stop Loss distance = ATR × this multiplier.
- RiskRewardRatio (default 2.0) — Take Profit distance = Stop Loss distance × this ratio.
- RiskPercent (default 1.0) — percentage of account balance risked per trade, used to calculate lot size. Ignored if
UseFixedLotis enabled. - UseFixedLot — switches position sizing from risk-based to a constant lot size.
- FixedLotSize — the constant lot size used when
UseFixedLotis enabled. - MaxSpreadPoints (default 30) — skips new entries while the spread is wider than this, the same concern covered in Spread and Slippage.
- EnableTrading — a master on/off switch, useful for pausing the EA without removing it from the chart.
- MagicNumber (default 20260720) — the identifier tagged on every order this EA places, so its position-management logic never touches trades opened manually or by a different EA.
Why Confluence Matters
Most single-indicator EAs on this site — an RSI reversal EA that trades purely off Overbought/Oversold, or a Stochastic crossover EA that trades purely off a %K/%D cross — act the moment their one condition is true. That makes them responsive: they catch every qualifying reading, including the ones that turn out to be false starts. This EA takes the opposite tradeoff. Because it requires the Bollinger Band touch and the RSI extreme to occur on the same bar, it will sit out many situations where only one of the two is present — RSI drops into oversold territory while price is still comfortably inside the bands, or price tags the lower band while RSI is only mildly soft, say in the 40s. Neither of those, alone, is a signal this EA takes.
Concretely: imagine EUR/USD grinding steadily lower in a strong downtrend. Price will touch or pierce the lower band repeatedly during that slide, but RSI can stay in the 20s-40s for many bars without ever giving the kind of momentum-exhaustion reading this EA is looking for — a single-indicator band-touch EA would have already fired several BUY signals into a trend that just kept falling, while this EA stays flat until RSI genuinely confirms exhaustion, which is often much closer to the actual low. The cost of that patience is trade frequency: this EA will generate noticeably fewer signals over a given month than a single-indicator equivalent, and there will be stretches where it takes no trades at all even though the chart looks eventful. What it buys back for that lower frequency is that each signal it does take carries the weight of two independent confirmations rather than one, which is generally a better trade for a strategy that stakes real risk-based position sizing on every entry — fewer, better-supported trades over more, noisier ones.
Installation and Setup
EAs install into a different folder than indicators — this is the step people miss most often.
- Download the file below for your platform.
- Open MetaTrader → click
File→Open Data Folder. - Place the file in
MQL4/Experts(MetaTrader 4) orMQL5/Experts(MetaTrader 5) — not the Indicators folder. - Restart MetaTrader, then drag the EA from the Navigator window onto a chart.
- Enable AutoTrading (MT4) or Algo Trading (MT5) in the toolbar — the EA will not place any trades while this is off, even if it's attached to a chart.
- Review and adjust the input parameters in the EA's settings dialog before confirming.
A Word of Caution
Test on a demo account first, across different market conditions, before risking real money — past performance, in backtests or live, never guarantees future results. No strategy, automated or manual, wins every trade, and this EA can and will lose money on individual trades; requiring confluence reduces how often it fires into a false signal, it does not eliminate losing trades. Both files are source code — open and review them fully, and understand what every parameter does, before using it. This content is general education, not personalized investment advice.
Download the EA
How to Install — MetaTrader 4
- Download the
bollinger-reversal-ea.mq4file below. - Open MetaTrader 4 → click
File→Open Data Folder. - Place the file in the
MQL4/Expertsfolder. - Restart MetaTrader 4, then drag the EA from the Navigator window onto the chart.
How to Install — MetaTrader 5
- Download the
bollinger-reversal-ea.mq5file below. - Open MetaTrader 5 → click
File→Open Data Folder. - Place the file in the
MQL5/Expertsfolder. - Restart MetaTrader 5, then drag the EA from the Navigator window onto the chart.
Both files are source code — open and review the full code before using it, for your own safety.