Inside Bar and Engulfing Candle Scanner
Info
The Inside Bar and Engulfing Candle Scanner is a Indicator for MetaTrader 5 that this indicator scans for two common candlestick patterns: engulfing candles and inside bars on any symbol and timeframe. It analyzes every closed candle in relation to the one immediately preceding it.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Inside Bar and Engulfing Candle Scanner
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
This indicator scans for two common candlestick patterns: engulfing candles and inside bars on any symbol and timeframe.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Inside-Bar Outcome Tracker: Analyzing Breakout Direction, Failure Rate, and Time to Resolve - another powerful indicator for MetaTrader 5 traders.
This indicator scans for two common candlestick patterns: engulfing candles and inside bars on any symbol and timeframe.Also recommended: Volatility Squeeze Scanner: Bollinger Inside Keltner with Momentum - similar indicator with strong performance on MetaTrader 5.
It analyzes every closed candle in relation to the one immediately preceding it.
A bullish engulfing pattern occurs when a bearish candle is followed by a bullish candle whose body completely engulfs the previous bearish candle's body. A bearish engulfing pattern is the inverse.
An inside bar pattern is identified when a candle's high and low are contained entirely within the high and low range of the previous candle (the mother bar).
Visual Indicators:
- Bullish engulfing patterns are marked with an arrow below the low of the pattern candle.
- Bearish engulfing patterns are marked with an arrow above the high of the pattern candle.
- Inside bars are marked with a dot.
For newly formed inside bars, the range of the mother bar is highlighted with a box that extends several bars into the future, allowing traders to observe which side the price eventually breaks out from.
The indicator does not mark forming candles to avoid signals that may vanish.
Pattern Filters and Settings:
Pattern Selection:
- Enable or disable the detection of bullish engulfing, bearish engulfing, and inside bar patterns.
Engulfing Rule Options:
- Standard: The body of the engulfing candle must cover the body of the previous candle. The engulfing body must also be larger than the previous body.
- Full Candle: The body of the engulfing candle must cover the entire previous candle, from its high to its low. The engulfing body must also be larger than the previous body.
Minimum Engulfing Candle Body Size:
- Specify a minimum body size for engulfing candles, measured in Average True Range (ATR) units. A value of 0 disables this filter.
ATR Period:
- Sets the period for ATR calculation, defaulting to 14. This period is also used to determine the distance of the arrows from the price.
Inside Bar Strictness:
- Option to allow inside bars to touch the high or low of the mother bar. By default, this is off, requiring the inside bar to be strictly within the mother bar's range.
Trend Filter (EMA):
- Enable a trend filter using an Exponential Moving Average (EMA). When active (period > 0), bullish engulfing patterns are only counted if they appear above the EMA, and bearish engulfing patterns are only counted if they appear below the EMA.
- Trend EMA Period: Sets the period for the EMA, defaulting to 0 (off).
Visual Settings:
- Arrow Distance: Sets the distance of the arrows from the price in ATR units (default 0.3).
- Arrow Colors: Customize the colors of the pattern arrows.
- Mother Bar Box: Toggle the display of the box highlighting the mother bar range for inside bars (default on).
- Box Extension Bars: Define how many bars the mother bar range box extends into the future (default 5).
- Maximum Boxes: Limit the number of displayed mother bar boxes (newest first, default 5).
- Bars to Scan: Set the maximum number of historical bars to analyze (default 2000, 0 scans all available bars).
Alerts:
- Individual alerts can be enabled for each pattern type (bullish engulfing, bearish engulfing, inside bar).
- Alerts trigger as a popup, push notification, or sound, occurring on the bar that just closed.
- All alerts are off by default.
Object Prefix:
- Allows running multiple instances of the indicator on the same chart by assigning a unique prefix to the indicator objects.
Technical Requirements:
- Works on any symbol and any timeframe.
- Utilizes the built-in ATR indicator.
- Uses the built-in EMA indicator only when the trend filter is active.
- Patterns are stored in arrow buffers (0: bullish engulfing, 1: bearish engulfing, 2: inside bar). Empty values indicate no pattern.
- An Expert Advisor (EA) can read these buffers using iCustom on bar 1.
- The indicator itself does not initiate trades.
- Push notifications require the MetaQuotes ID to be configured in the terminal settings.
Customization and Application:
- Recommended symbols for testing include XAUUSD, XAGUSD, EURUSD, GBPUSD, US30, and NAS100.
- Experiment with different timeframes such as M15, H1, and H4.
- Compare the results of the standard engulfing rule versus the full candle rule to assess signal frequency.
- Consider analyzing engulfing candles in conjunction with support and resistance levels, or Smart Money Concepts order blocks.
- The XP_Pattern function integrates these three patterns and provides a code output that can be incorporated into custom EAs. A session filter can be implemented in the main EA loop.
About the Code:
- This is an open-source indicator. Users are encouraged to use, adapt, and build upon it.
- Questions, suggestions, and user tests are welcomed in the comments section.
- The indicator is provided as-is, and its use is at the user's own risk.
Related Tools:
- Supply Demand Zones
- Order Blocks Zones
- Supertrend Gold Signals
- Candle Timer Countdown
Changelog
v1.0 (2026-11-30): initial release.
You may also like: Candle Pattern Statistics: Engulfing, Pin Bar, and Inside Bar with Rolling Hit Rate - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots 3
#property indicator_label1 "Bullish engulfing"
#property indicator_type1 DRAW_ARROW
#property indicator_color1 clrDodgerBlue
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.