Skip to content
All library documents

Automating Bullish and Bearish Engulfing Patterns with Pending Orders

Article MQL5 articles

Summary

The article explains how to identify bullish and bearish outside bars from two completed candles and translate those patterns into an automated Forex strategy. For a bullish signal, the outside bar must exceed the prior candle’s high and low, close above its open, and engulf the prior candle’s body; the bearish conditions reverse the candle directions. It recommends using higher timeframes, avoiding signals during sideways markets, and placing pending orders just beyond the outside bar for confirmation. Stops go beyond the bar’s opposite extreme, while profit targets are set before nearby resistance or support.

The implementation discussion describes an MQL4 Expert Advisor that reads candle data, detects patterns, and exposes configurable trading parameters. The article reports Strategy Tester optimization results on several currency pairs using EURAUD daily data from 2014 as its example. Those results are historical and optimized, with no out-of-sample validation or transaction-cost discussion presented, so they do not establish a durable trading edge. The EA’s practical value is as a framework for testing a clearly specified price-action rule.

Key ideas

  • A bullish or bearish outside bar must extend beyond both extremes of the previous candle.
  • Pending entries beyond the outside bar aim to confirm price movement before opening a trade.
  • The stop is placed beyond the opposite extreme of the signal bar, with targets set ahead of nearby support or resistance.
  • The article recommends higher timeframes and avoiding repeated signals in flat markets.
  • Reported tester results come from optimized historical data and do not prove future profitability.

Tags

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