Engulfing Follow Through Table
"Engulfing bar" gets used loosely - anything that closed a bit further than the prior bar closed. This script only counts a real one: the current bar's body must be strictly larger than the prior bar's body, must fully cover it (the current open at or beyond the prior close, the current close at or beyond the prior open), and the two bars must point in opposite directions. Ties and near-misses are excluded rather than counted generously. For every genuine engulfing bar found in the loaded history, it reads a fixed number of bars later and measures the move in the direction the pattern implied - up for a bullish engulfing, down for a bearish one - in pips. Each event is also tagged with whether it agreed with the prevailing trend (price above or below a simple moving average at the time) and which trading session it printed in. The results are tabulated by pattern type, trend context and session together - 16 buckets in all - because a bullish engulfing printing with the trend during the European session is not the same event, statistically, as one printing against the trend overnight, and pooling them into one "engulfing win rate" hides exactly the distinction a trader would want to act on. Notes and limitations - The trend filter is a single simple moving average read at the pattern bar's close; it is a coarse, mechanical trend definition, not a claim about the "real" trend regime. - Session windows are applied to the pattern bar's own timeframe - on a timeframe coarser than the session length (for example a D1 chart) the session tag becomes close to meaningless, since one bar can span every session; this is intended for intraday timeframes. - The forward return is read from a single bar's close InpFollowBars later, not from any excursion in between - a pattern that moved favourably and then reversed before the check bar is scored on where it ended up, not on the best point reached. - This is a descriptive study, not a trading signal. It ignores spread and slippage, and any single bucket's win rate should be read alongside its count - several of the 16 buckets can end up thin on a short history.
Script · MT4 · v1.0 · Free
About Engulfing Follow Through Table
Engulfing Follow Through Table is a script for MetaTrader 4 based on Moving Average. It can alert you with a pop-up, sound, email or push message and marks candlestick patterns. It has 12 settings, such as Symbol, Timeframe and Max bars. MQL source code included.
Files in the download: EngulfingFollowThrough.mq4, EngulfingFollowThrough.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to study, blank = this chart's symbol | |
| Timeframe | PERIOD_H1 | Timeframe to study |
| Max bars | 3000 | Most recent bars to include |
| Trend ma period | 50 | SMA period used to define the prevailing trend |
| Follow bars | 5 | Bars after the engulfing bar checked for the outcome |
| Asian start hour | 0 | Asian session start, broker server time (0-23) |
| Asian end hour | 8 | Asian session end, broker server time (exclusive) |
| Europe start hour | 8 | European session start, broker server time (0-23) |
| Europe end hour | 16 | European session end, broker server time (exclusive) |
| Us start hour | 13 | US session start, broker server time (0-23) |
| Us end hour | 21 | US session end, broker server time (exclusive) |
| Save csv | true | Write every engulfing bar's outcome to a CSV file |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Candlestick Patterns · Trend · Trading Sessions · Alerts · Moving Average · MT4 Script · MQL4 Source Code