Skip to content

Free MT5 Expert Advisor

Liquidity Sweep Reversal EA

MT5 Expert Advisor that waits for a sweep of a prior swing high or low that closes back inside, then enters on a market-structure shift.

Smart moneyv1.0MetaTrader 5 (MQL5) Compiles with 0 errors Non-repainting signals Stop-loss on every trade
Strategy
Sells when a candle trades above an untouched swing high but closes back below it and price then closes below the recent low that led into the sweep; buys on the mirror image at swing lows.
Risk model
1% of balance per trade (configurable), stop-loss beyond the sweep extreme on every order, one position per symbol and magic number

What it does

Obvious swing highs and lows tend to collect stop orders. When price spikes through such a level and then closes back inside, the move is often called a liquidity sweep. Liquidity Sweep Reversal EA looks for that pattern and then waits for confirmation, a close through the nearby structure in the opposite direction, before it enters.

The stop sits just beyond the sweep extreme, so the trade is wrong as soon as price moves past the spike.

How it works

The EA uses closed candles only, checked at each new bar:

  1. Resting liquidity: the latest swing high (higher than the 5 bars on each side) that no later candle has traded above.
  2. Sweep: the last closed candle trades above that swing high but closes below it. Each swing can be swept only once.
  3. Shift level: the lowest low of the 5 candles before the sweep candle.
  4. Trigger: if a candle closes below the shift level within 6 bars, the EA sells at market. If price trades above the sweep high first, or the time runs out, the setup is cancelled. If the sweep candle itself already closes below the shift level, the EA enters at once.
  5. The stop goes above the sweep high plus 0.2 ATR; the target is 2 R.

Buys follow the mirror rules at untouched swing lows.

How to use it

The pattern appears on every timeframe; M5 to H1 during the London and New York sessions are a practical start. A larger swing strength picks only well-known levels, which are swept less often but more meaningfully. Shorter shift lookbacks give quicker, tighter confirmations. The Experts tab shows each sweep and the level the EA is waiting for.

Settings

InputDefaultWhat it changes
Swing strength5Significance of the swept level
Lookback bars120How far back to search for untouched swings
Shift lookback5Bars that define the confirmation level
Shift max bars6Time allowed for confirmation
Stop buffer (x ATR)0.2Room beyond the sweep extreme
Max stop (x ATR)3.0Skips very large spikes
Risk % / Fixed lots1.0 / 0Position sizing
Take-profit (R)2.0Target distance (0 = none)
Max spread / hours30 points / 7 to 20Entry filters
Break-even / Trailingon at 1 R / offTrade management

Limitations

This is a counter-move strategy: in strong trends, sweeps are frequently followed by continuation rather than reversal. There is no trend filter by design, so expect losing streaks when markets trend hard. News releases produce spikes that look like sweeps but behave unpredictably. The confirmation close can come far from the sweep extreme, which means a wide stop and a small position.

Before you run it live

Run the EA in the Strategy Tester and on a demo account first, and look at the trades it takes around news. Consider limiting the trading hours to your main session. Check your broker's spread and stops level, and keep the risk small. Our lesson on support and resistance explains why swing levels attract orders. Trading carries a substantial risk of loss.

Key inputs

Key inputs of Liquidity Sweep Reversal EA
InputDefaultDescription
Swing strength5Bars on each side a swing needs before it counts as resting liquidity.
Shift lookback5Bars before the sweep whose low or high defines the shift level.
Shift max bars6Bars allowed after the sweep for the shift to happen.
Stop buffer (x ATR)0.2Extra distance beyond the sweep extreme for the stop-loss.
Risk per trade (%)1.0Share of balance risked between entry and stop-loss.
Take-profit (R)2.0Target as a multiple of the stop distance.

Educational tools, not advice. Automated trading can lose money quickly. Indicators and Expert Advisors describe price; they do not predict it, and past behaviour does not guarantee future results. Test everything on a demo account first and never risk money you cannot afford to lose. See our disclaimer.

Keep exploring

Related mt5 expert advisors