Skip to content
All library documents

Detecting Liquidity Sweeps with Candle Rules and a Moving Average Filter

Article MQL5 articles

Summary

This tutorial describes an MQL5 expert advisor that marks potential liquidity sweeps on a chart. A bullish setup requires a candle to trade below the prior candle’s low and then close higher; a bearish setup trades above the prior high and closes lower. In the less strict mode, the close must reclaim the prior candle’s open, while strict mode requires reclaiming beyond its high or low. The previous candle must not be a doji. Optional settings require a candle color change and apply a moving average filter to retain signals on one side of the average.

The EA draws arrows and can alert when its conditions are met; the article presents historical and live-simulation chart examples as evidence of its detection behavior. It does not provide quantitative performance statistics or a defined out-of-sample evaluation. Its explanation of sweeps as institutional stop hunts is an interpretation, and the described signals should be understood as pattern rules rather than proof of institutional activity or reliable trading results.

Key ideas

  • A bullish sweep is defined by a move below the prior low followed by a qualifying upward close.
  • A bearish sweep is defined by a move above the prior high followed by a qualifying downward close.
  • Strict mode requires the close to reclaim beyond the prior candle’s full range boundary.
  • Optional candle-color and moving-average conditions can filter detected signals.
  • The EA marks patterns visually, but the article provides no quantified evidence of trading profitability.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.