An engulfing candle swallows the one before it. That definition is loose, so it catches a lot of noise. The engulfing candle alert indicator adds two filters. The new body must beat the previous body by a ratio you set. It must also clear a minimum size in pips. A third switch raises the bar again, asking the candle to cover the wicks too.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 2: Bullish Engulfing, Bearish Engulfing |
| Alerts | popup, push notification |
| Inputs | 6 |
On the chart: plots and colours
Bullish Engulfing places a lime arrow under a candle whose body swallowed a prior bearish body.
Bearish Engulfing places a red arrow above the opposite case.
Arrows sit a fixed number of points from the candle, set through the offset input.
No lines, zones or labels appear on the chart.
- Bullish Engulfing: arrow, lime, width 2, arrow code 233
- Bearish Engulfing: arrow, red, width 2, arrow code 234

Behind the plots
Comparing the two bodies
pBody measures the previous candle as MathAbs(closeA[i+1] – openA[i+1]). cBody does the same for the current one. prior_bearish and prior_bullish record which way the earlier candle went. A bullish engulfing needs a bearish candle to swallow. Body sizes drive this first test, so wicks play no part in it.
Testing the overlap
Four edges do the work. prior_body_high and prior_body_low take MathMax and MathMin of the earlier open and close. cur_body_high and cur_body_low do the same for the current bar. engulf holds when cur_body_low sits at or below prior_body_low, and cur_body_high at or above prior_body_high. The new body has to cover the old one on both sides.
Raising the bar with wicks
Set `InpRequireWick` and the code tightens engulf further. cur_body_low must also reach below lowA[i+1], and cur_body_high above highA[i+1]. That asks the new body to swallow the whole prior candle, wicks and all. It is a far stricter pattern than the textbook version. `InpBodyRatioMin` and `InpMinBodyPips` filter separately. They catch the cases where a technically engulfing candle is simply tiny.
Reading the plots
An arrow means the body test and both size filters passed together.
Turning the wick option on will cut the signal count sharply, and the survivors look far more decisive.
The pattern says nothing about location. An engulfing candle at a tested level reads differently from one mid-range.
A minimum pip size keeps doji-sized bodies out, which matters most on quiet sessions.
Alert channels in this build: popup and push notification, one message per closed bar.
Two channels ship here. A terminal popup runs under `InpEnableAlerts`, on by default. A mobile push notification runs under `InpEnablePush`, off by default. There is no email or sound option. The code checks time[1] against its stored bar, so a message follows a candle that has closed.
Every Engulfing candle alert Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpBodyRatioMin |
Current body must exceed prior body by this ratio. How much bigger the new body must be than the prior one, default `1.05`. Raise it toward 1.5 to demand a decisive candle. | 1.05 |
InpMinBodyPips |
Minimum current body size in pips (filter doji). Smallest current body that counts, default `1.0` pip. This is what filters out doji-sized engulfing candles. | 1.0 |
InpRequireWick |
Require current body to engulf prior wick as well. Off by default. Set it `true` and the body must swallow the previous candle’s wicks as well as its body. | off |
Display settings
| Setting | What it does | Default |
|---|---|---|
InpArrowOffset |
Arrow offset in points from candle. Distance between candle and arrow, default `10` points. | 10 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
InpEnableAlerts |
Enable pop-up alerts. | on |
InpEnablePush |
Enable push notifications. | off |

Where to run it
Engulfing patterns need candles with real bodies. H1 and above read clearest, and EURUSD H1 is the reference chart. On M1 and M5 the 1.0 pip minimum does a lot of work, because many bodies barely exceed the spread. Gold and indices produce larger bodies. Raise `InpMinBodyPips` there so the filter still means something.
The rough edges
Engulfing candles cluster around news. A large body there reflects a spread jump rather than a real shift in control.
A ratio of 1.05 is barely a filter. Two nearly equal bodies still qualify, and those are the weakest examples.
The tool reads two candles and nothing else. It has no view on trend, level or session, all of which change what the pattern is worth.
Copy the compiled Engulfing candle alert Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Background reading on the method behind the Engulfing candle alert Indicator: Foreign exchange regulation on Wikipedia, S And P 500 Sector And Industry Groups at StockCharts ChartSchool.
Download the Engulfing candle alert Indicator for MT4 and MT5
The zip holds the compiled Engulfing candle alert Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
What does InpRequireWick change?
It moves the test from bodies to full ranges. With it off, the current body only has to cover the previous body. With it on, cur_body_low must also reach under lowA[i+1] and cur_body_high must clear highA[i+1]. The new body then swallows the whole prior candle. Expect far fewer arrows, and much stronger ones.
Why is InpBodyRatioMin only 1.05 by default?
Because the classic definition just needs the new body to be larger, and 1.05 barely enforces that. It exists so you can tighten it. At 1.5 the new candle must be half again the size of the one it swallows, which removes the marginal cases where two bodies are effectively equal.
What is InpMinBodyPips filtering out?
Tiny candles. A doji can technically engulf an even smaller doji, and that pattern means nothing. Requiring the current body to clear `1.0` pip removes those. On instruments with bigger typical ranges, such as gold, raise it so the filter still does something.
Does the Bullish Engulfing arrow need a downtrend first?
No, and that is a real limitation. This build tests the two candles alone. Most traders treat an engulfing candle as meaningful only after a move the other way. You will need to supply that context yourself, from the chart or another tool.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Engulfing candle alert Indicator as one input. Always backtest before trading live.
Category: this is part of our Candle Sticks collection. Then, plainly, browse more Candle Sticks for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- The core method is documented in Foreign exchange regulation on Wikipedia.
- Additional market context is at S And P 500 Sector And Industry Groups at StockCharts ChartSchool.
