Engulfing Detector by RWBTradeLab
- Indicadores
-
Md Hasibul Kabir
Founder & Developer at RWBTradeLab.
I develop high-quality trading indicators, expert advisors (EAs),
and utility tools for MetaTrader 5.
My work focuses on precise calculations, non-repainting logic,
and clear visual market structure. - Versão: 1.10
- Atualizado: 2 setembro 2026
Engulfing Detector by RWBTradeLab
A clean, non-repainting engulfing pattern detector for MetaTrader 5 that finds BOTH kinds of engulfing — the classic 2-candle Regular Engulfing and the extended multi-candle E-Regular Engulfing that most indicators miss — and separates the ones that swept liquidity first from the ones that did not. Every pattern is marked as a clear zone box on the chart, all from CLOSED candles only.
What This Indicator Does
The indicator detects 8 pattern types by CLOSE-based engulfing (a candle must CLOSE beyond the base candle's range — wicks alone don't count). The eight types are built from three independent facts, so the naming never gets confusing:
- side: Buy or Sell
- speed: Regular (R) or E-Regular (ER)
- sweep: plain, or Type 1 (T1)
Regular Engulfing (2 candles)
- R Buy EG: a Red base candle, and the VERY NEXT candle is Green and CLOSES above the base high
- R Sell EG: a Green base candle, and the VERY NEXT candle is Red and CLOSES below the base low
E-Regular Engulfing (multi-candle)
- ER Buy EG: a Red base candle followed by a run of consecutive Green candles (Dojis are skipped, any Red candle cancels the run); the close ABOVE the base high must happen on the 2nd or later Green candle
- ER Sell EG: the exact mirror — a Green base, a run of Red candles, the close BELOW the base low on the 2nd or later Red candle
If the FIRST candle already engulfs the base, that is a Regular pattern — a Regular pattern on the same base always takes precedence over E-Regular.
Type 1 (the sweep version)
Type 1 adds one extra fact to either of the patterns above: price also traded through the OPPOSITE side of the base candle before the close broke it. That is a liquidity sweep — stops on the wrong side were taken out first, and only then did the engulfing close happen.
- T1 R Buy EG: the confirming Green candle's low went to or below the base candle's low, and it still closed above the base high
- T1 R Sell EG: the confirming Red candle's high went to or above the base candle's high, and it still closed below the base low
- T1 ER Buy EG / T1 ER Sell EG: the same idea over a run — ANY candle of the run may carry the sweep, the confirming candle included
A pattern is either plain or Type 1, never both, so the eight types never overlap and never double-count.
Key Features
Professional Chart Display
- Every pattern is drawn as a ZONE BOX from the base candle to the confirmation candle, covering the base candle's full high-low range
- The box style tells you the type at a glance: solid border = Regular, dashed border = E-Regular, thick border = Type 1
- Type 1 zones are filled a step brighter than plain zones (adjustable), so swept patterns stand out when zones sit close together
- On a Type 1, the raided base level is marked with a dotted line across the zone, so you can see exactly which level was swept
- Boxes are drawn BEHIND the candles — price action always stays readable
- Clear text labels ("R Buy EG", "T1 ER Sell EG", ...) placed below Buy zones and above Sell zones
- Label distance scales with the base candle's height (percentage based)
Summary Panel
- A compact panel in the chart corner lists all 8 types with how many of each are currently on the scanned range
- Every cell is drawn as its own filled box with a thin grid line, so it reads the same on a white chart and on a black one
- The panel counts a type even while that type is hidden, so it tells you what is really there and not just what is drawn
- Four corner positions, adjustable font size and colours, and it can be switched off entirely
Non-Repainting Engine
- All patterns are calculated on CLOSED candles only — no running-candle logic
- Patterns are rescanned once per new bar, not on every tick (zero terminal lag)
- Automatic object cleanup — remove the indicator and the chart is spotless
Chart = Alerts, Always
- Drawing and alerts share the SAME detection rules
- An alert fires exactly when a pattern's confirmation candle closes — once per pattern, never repeated
- Whatever fires an alert is exactly what you see on the chart
Alerts (bar-close only, off by default)
- 8 alert types, one per pattern type, each with its own On/Off switch
- 3 delivery channels: Popup, Push Notification, Email
- Every alert message includes pattern type, price, symbol, timeframe and time
Inputs
- Scan: Scan Length (closed candles) — how many recent closed candles are scanned (default 50)
- Pattern Types: an On/Off switch for each of the 8 types
- Zone Style: Buy and Sell zone colours, Buy and Sell label text colours, Type 1 extra emphasis, Mark Swept Level switch and its colour
- Labels: show labels, text offset from box (% of base candle height, min 20), font and font size
- Summary Table: show/hide, corner, font size, text colour, header background, cell background, grid colour
- Alerts: master switch, Popup / Push / Email, and a switch per pattern type
How to Use
Attach the indicator to any symbol and any timeframe — forex, gold, indices, crypto. A Buy Engulfing box marks a zone where sellers were fully absorbed by a close above the base high — watch it as a potential demand zone on retest. A Sell Engulfing box is the mirror supply zone. E-Regular patterns show the same absorption happening over several candles. Type 1 patterns are the ones where the opposite side was raided first, which many traders treat as the cleaner version because the obvious stops are already gone before the move starts. Use the Pattern Types switches to keep only the types you actually trade on the chart, and read the panel to see what the rest of the range is holding. For best results combine with higher-timeframe structure and your own trade plan.
Important Notes
- Push notifications require your MetaQuotes ID in MT5 (Tools -> Options -> Notifications); email alerts require SMTP settings
- Alerts work while the terminal is running
- Default colours are tuned for dark charts — all colours are fully adjustable for light themes
- This indicator is a pattern-detection tool, not financial advice. Trading involves risk — always use proper risk management
Creator: RWBTradeLab
If you find this indicator useful, please leave a review and share your feedback.
