Retail Institutional Engulfing Candlestick Filter
- Göstergeler
- Sürüm: 1.0
- Etkinleştirmeler: 5
Retail Institutional Engulfing Candlestick Filter
1. Overview
Dual Engulfing Retail Institutional Multi Filter ATR is a native MetaTrader 4 (MT4) technical chart indicator designed to detect, classify, and filter bullish and bearish engulfing candlestick patterns in real time upon candle close. Instead of treating every overlapping two-candle formation as equal, the indicator separates price action into two distinct analytical tiers: Retail Engulfing for standard real-body reversals and Institutional Engulfing for high-momentum outside-bar expansions confirmed by relative body strength, tick-volume expansion, and strong closing-range positioning. To help filter out low-probability setups during sideways or counter-trend market phases, the indicator embeds a modular 15-filter technical confluence suite directly into its calculation engine, paired with automatic Average True Range (ATR) Entry, Stop Loss (SL), and multi-stage Risk-to-Reward Take Profit (TP1, TP2, TP3) projection lines. This software operates strictly as an analytical and visual charting tool and does not execute automated trading orders.
2. Operating Principle
- Dual-Tier Engulfing Architecture: The indicator continuously evaluates closed candlesticks on the active chart to detect directional reversals where a momentum candle engulfs the real body of the immediately preceding opposite-colored candle. Minor broker tick micro-jumps between bar close and the subsequent bar open are accommodated via a configurable strictness parameter so valid formations are not skipped on variable-spread feeds.
- Retail Engulfing Classification: Identifies standard two-candle body engulfing reversals and optionally verifies that a minimum sequence of preceding opposite-colored candles established a short-term directional swing before the reversal candle closed.
- Institutional Engulfing Classification: Applies multi-layered structural validation on top of standard body engulfment, requiring full high-to-low outside-bar range coverage, a minimum relative real-body expansion ratio, higher tick volume than the prior candle, a decisive close near the directional extreme of the candle range, and an extended preceding directional sequence.
- Modular 15-Filter Technical Confluence Engine: Every candidate Retail or Institutional pattern is routed through an integrated multi-indicator validation pipeline before any signal is plotted. Traders can activate any single filter or combine multiple filters simultaneously; a signal arrow is generated only when every enabled filter aligns with the signal direction.
- Integrated Filter Categories: The built-in confluence engine spans four analytical domains: momentum oscillators (RSI threshold crossovers, long-period RSI midline regime, multi-mode Awesome Oscillator amplitude/slope/zero-line checks, CCI zero-line trend, CCI momentum thresholds, and RVI trend/signal crossovers), trend baselines (Single Moving Average, Double Moving Average alignment, Ichimoku Senkou Span B, Parabolic SAR, MACD histogram/zero-line, Heiken Ashi smoothed polarity, and Wilder-ATR Supertrend), trend strength (ADX minimum threshold), and market structure (dynamic local Support/Resistance proximity zones and swing-anchored Fibonacci retracement pullbacks).
- Signal Validity and Repainting Transparency: All candlestick pattern checks and standard indicator filters are evaluated strictly on closed historical bars (Bar 1 and older), while the currently forming candle (Bar 0) is excluded from signal plotting. Once a bar closes and plots a Retail or Institutional arrow, that marker remains fixed on the chart and does not shift or disappear. Note that if the optional Fibonacci Retracement filter (Use_Fib_Filter) is enabled, internal swing-high and swing-low detection relies on ZigZag-style pivot lookback parameters, meaning swing anchor points dynamically adjust until confirmed by subsequent price bars.
- Bullish BUY Signal Conditions: Triggered upon candle close when a bullish candle engulfs a preceding bearish candle, satisfies either Retail or Institutional structural rules, meets the required preceding bearish candle count (when trend context is enabled), and passes all active filters in the 15-filter suite.
- Bearish SELL Signal Conditions: Triggered upon candle close when a bearish candle engulfs a preceding bullish candle, satisfies either Retail or Institutional structural rules, meets the required preceding bullish candle count (when trend context is enabled), and passes all active filters in the 15-filter suite.
- ATR Risk-to-Reward Target Projection: Whenever a valid signal exists on the chart, the indicator reads the ATR value on the signal bar, computes a baseline volatility risk distance (1R) using the configured ATR multiplier, and draws horizontal reference lines for Entry, Stop Loss (1R), TP1 (1R), TP2 (2R), and TP3 (3R) for the most recent confirmed signal only. Because this tool is a visual indicator without automated trade execution, position sizing and trade management remain entirely under the trader's control.
3. Key Features
- Independent Dual Signal Buffers: Separate plot buffers and toggle switches allow Retail and Institutional engulfing signals to be displayed individually or side by side on the same chart.
- Self-Contained 15-Filter Confluence Suite: All 15 technical filters are compiled natively inside the indicator without requiring external custom indicator files in the MQL4 Indicators folder.
- Automatic Latest-Signal ATR Target Lines: Dynamically updates horizontal Entry, SL, TP1, TP2, and TP3 lines and price labels exclusively for the newest signal to keep chart workspace clean and readable.
- Graphical User Interface (GUI) and Color Coding: Uses distinct Wingdings arrow markers and automatic vertical separation so Retail and Institutional arrows never overlap when both trigger on the same candle. By default, Aqua arrows indicate Retail BUY signals, Red arrows indicate Retail SELL signals, DodgerBlue arrows indicate Institutional BUY signals, and Magenta arrows indicate Institutional SELL signals. Target projection lines default to Gold for Entry, Red for Stop Loss, LimeGreen for TP1 (1R), MediumSeaGreen for TP2 (2R), and DodgerBlue for TP3 (3R).
- Four-Channel Notification Dispatcher: Supports on-screen MT4 pop-up alert windows, distinct customizable WAV audio files for BUY and SELL signals, MetaQuotes ID mobile push notifications, and SMTP email alerts triggered once per closed signal bar.
- Computational Efficiency and Memory Control: Incorporates a configurable historical scan limit (InpMaxHistoryBars), incremental single-bar updates after initial load, and conditional evaluation that skips inactive filter modules to conserve CPU and RAM resources.
4. Operation and Setup Recommendations
- Supported Instruments: Suitable for major and minor Forex currency pairs (such as EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD), spot metals (XAUUSD), equity indices, and liquid CFD symbols. Traders should confirm that their broker provides reliable tick-volume updates before enabling volume-dependent Institutional filtering.
- Recommended Timeframes: Compatible with all standard MT4 timeframes. Intraday and short-term traders commonly apply M5, M15, or M30 paired with trend and volatility filters, while day and swing traders typically prefer H1, H4, or D1 for higher candlestick structural reliability and cleaner volume distribution.
- Broker Account and Feed Compatibility: Operates smoothly on both Hedging and Netting MT4 accounts across Standard and ECN/Raw spread feeds. Because bar open/close prices and tick counts differ slightly between liquidity feeds, keeping broker tick-jump tolerance enabled (InpStrictOpenEqualClose = false) is recommended for consistent cross-broker behavior.
- Multi-Chart CPU and Memory Guidelines: All 15 technical filters are disabled by default so the indicator runs with minimal overhead upon attachment. Activate only the specific filters required by your trading plan. When running the indicator simultaneously across multiple open charts on lower-specification terminals, keep InpMaxHistoryBars at 1000 or lower to minimize initial load time and memory footprint.
5. Input Parameters Documentation
Note: Visual section header strings displayed in the MT4 Inputs tab (InpSection1, InpSubSignalControl, InpSubSignalAppear, InpSubRetailSettings, InpSubInstSettings, InpSubAlerts, InpSection2, InpSection3, and InpFilter1 through InpFilter15) serve strictly as non-functional layout dividers. Every functional input parameter is documented below with its default value, technical role, and unit:
- InpEnableRetail (Default: true) -> Enables or disables standard Retail Engulfing pattern detection and arrow plotting (Unit: boolean true/false).
- InpEnableInstitutional (Default: true) -> Enables or disables advanced Institutional Engulfing pattern detection and arrow plotting (Unit: boolean true/false).
- InpStrictOpenEqualClose (Default: false) -> Enforces strict candle open versus previous close alignment when true, or allows minor broker tick micro-jumps between bar close and next bar open when false (Unit: boolean true/false).
- InpMaxHistoryBars (Default: 1000) -> Maximum number of historical bars scanned during initial attachment and full recalculation; setting 0 scans all available chart history (Unit: bars).
- InpSignalOffset (Default: 30) -> Vertical spacing from the signal candle high or low to the plotted Retail arrow; Institutional arrows automatically add an extra 30-point vertical offset to prevent overlap (Unit: points).
- InpArrowCodeBuy (Default: 233) -> Wingdings symbol code used to render bullish BUY signal arrows below the candle low (Unit: Wingdings code).
- InpArrowCodeSell (Default: 234) -> Wingdings symbol code used to render bearish SELL signal arrows above the candle high (Unit: Wingdings code).
- InpRetailRequireTrend (Default: true) -> Requires a preceding sequence of opposite-colored candles before validating a Retail Engulfing signal (Unit: boolean true/false).
- InpRetailTrendBars (Default: 2) -> Minimum number of consecutive preceding opposite-colored candles required when InpRetailRequireTrend is enabled (Unit: bars).
- InpBodyMultiplier (Default: 1.5) -> Minimum ratio of the engulfing candle real body compared to the preceding candle real body for Institutional signals (Unit: multiplier factor).
- InpRequireHigherVolume (Default: true) -> Requires the Institutional engulfing candle tick volume to exceed the preceding candle tick volume (Unit: boolean true/false).
- InpMinClosePosition (Default: 0.70) -> Minimum normalized close position within the candle total high-to-low range (0.00 to 1.00) required to confirm directional closing strength on Institutional signals (Unit: range ratio).
- InpRequireFullOutside (Default: true) -> Requires an Institutional engulfing candle to exceed both the high and the low of the preceding candle (Unit: boolean true/false).
- InpInstRequireTrend (Default: true) -> Requires a preceding sequence of opposite-colored candles before validating an Institutional Engulfing signal (Unit: boolean true/false).
- InpInstTrendBars (Default: 3) -> Minimum number of consecutive preceding opposite-colored candles required when InpInstRequireTrend is enabled (Unit: bars).
- InpEnableAlerts (Default: true) -> Enables or disables on-screen MT4 pop-up alert dialog boxes when a new closed-bar signal triggers (Unit: boolean true/false).
- InpEnablePush (Default: false) -> Enables or disables push notifications dispatched via MetaQuotes ID to the MetaTrader mobile application (Unit: boolean true/false).
- InpEnableEmail (Default: false) -> Enables or disables email notifications sent through the terminal SMTP mail configuration (Unit: boolean true/false).
- InpEnableSound (Default: true) -> Enables or disables WAV audio alerts when a confirmed signal candle closes (Unit: boolean true/false).
- InpSoundBuy (Default: "alert.wav") -> Filename of the WAV sound located in the MetaTrader Sounds directory played on BUY signals (Unit: filename string).
- InpSoundSell (Default: "alert2.wav") -> Filename of the WAV sound located in the MetaTrader Sounds directory played on SELL signals (Unit: filename string).
- InpShowSLTP (Default: true) -> Enables or disables drawing horizontal Entry, Stop Loss, and Take Profit projection lines for the latest active signal (Unit: boolean true/false).
- InpATRPeriod (Default: 7) -> Lookback period used to calculate the Average True Range volatility baseline for SL and TP levels (Unit: bars).
- InpATRMultiplier (Default: 1.5) -> Multiplier applied to the signal-bar ATR value to compute the 1R Stop Loss distance from entry (Unit: multiplier factor).
- InpExtendBars (Default: 1) -> Number of bars to extend the horizontal Entry, SL, and TP lines to the right of Bar 0 (Unit: bars).
- InpFontSize (Default: 8) -> Font size for the Entry, SL, and TP text labels displayed on the chart (Unit: font points).
- InpColorEntry (Default: clrGold) -> Line and label color for the Entry reference level (Unit: MT4 color).
- InpColorSL (Default: clrRed) -> Line and label color for the Stop Loss (SL) reference level (Unit: MT4 color).
- InpColorTP1 (Default: clrLimeGreen) -> Line and label color for the first Take Profit level at 1R (Unit: MT4 color).
- InpColorTP2 (Default: clrMediumSeaGreen) -> Line and label color for the second Take Profit level at 2R (Unit: MT4 color).
- InpColorTP3 (Default: clrDodgerBlue) -> Line and label color for the third Take Profit level at 3R (Unit: MT4 color).
- InpTargetLineStyle (Default: STYLE_DASH) -> Visual line style applied to the SL, TP1, TP2, and TP3 horizontal lines (Unit: ENUM_LINE_STYLE).
- InpLineWidth (Default: 1) -> Pixel width for SL and TP lines; the Entry line draws 1 pixel thicker automatically for clear visual hierarchy (Unit: pixels).
- Use_RSI_Cross_Filter (Default: false) -> Enables or disables the RSI oversold/overbought threshold crossover filter (Unit: boolean true/false).
- RSI_Length (Default: 14) -> Lookback period for the RSI Cross calculation (Unit: bars).
- RSI_Price_Source (Default: PRICE_CLOSE) -> Applied candle price constant used in RSI calculations (Unit: ENUM_APPLIED_PRICE).
- RSI_Oversold (Default: 30.0) -> Lower RSI threshold that must be crossed upward to validate bullish signals (Unit: RSI index points).
- RSI_Overbought (Default: 70.0) -> Upper RSI threshold that must be crossed downward to validate bearish signals (Unit: RSI index points).
- Use_ADX_Filter (Default: false) -> Enables or disables the ADX minimum trend strength filter (Unit: boolean true/false).
- ADX_Period (Default: 10) -> Calculation period for the ADX indicator (Unit: bars).
- ADX_Min_Level (Default: 20.0) -> Minimum ADX main line value required to confirm directional trend activity (Unit: ADX index points).
- Use_MA_Filter (Default: false) -> Enables or disables the single Moving Average directional trend filter (Unit: boolean true/false).
- MA_Period (Default: 50) -> Lookback period for the single Moving Average filter (Unit: bars).
- MA_Method (Default: MODE_SMA) -> Smoothing algorithm (SMA, EMA, SMMA, or LWMA) applied to the single Moving Average (Unit: ENUM_MA_METHOD).
- MA_Shift (Default: 0) -> Horizontal bar shift applied to the single Moving Average line (Unit: bars).
- Use_Ichimoku_Filter (Default: false) -> Enables or disables the Ichimoku Kinko Hyo Senkou Span B directional baseline filter (Unit: boolean true/false).
- Ichimoku_Tenkan (Default: 9) -> Tenkan-sen conversion line period for Ichimoku (Unit: bars).
- Ichimoku_Kijun (Default: 26) -> Kijun-sen base line period for Ichimoku (Unit: bars).
- Ichimoku_SenkouB (Default: 52) -> Senkou Span B leading span period used to separate bullish and bearish price zones (Unit: bars).
- Use_RSI75_Filter (Default: false) -> Enables or disables the macro-period RSI 50.0 midline momentum regime filter (Unit: boolean true/false).
- RSI_Filter_Period (Default: 75) -> Lookback period for the macro RSI midline filter (Unit: bars).
- Use_DoubleMA_Filter (Default: false) -> Enables or disables dual Moving Average trend alignment confirmation (Unit: boolean true/false).
- MA_A_Period (Default: 30) -> Lookback period for the fast Moving Average line (MA A) (Unit: bars).
- MA_A_Method (Default: MODE_EMA) -> Smoothing method for the fast Moving Average line (MA A) (Unit: ENUM_MA_METHOD).
- MA_A_Applied (Default: PRICE_CLOSE) -> Applied price source for the fast Moving Average line (MA A) (Unit: ENUM_APPLIED_PRICE).
- MA_A_Shift (Default: 0) -> Horizontal bar shift for the fast Moving Average line (MA A) (Unit: bars).
- MA_B_Period (Default: 140) -> Lookback period for the slow Moving Average line (MA B) (Unit: bars).
- MA_B_Method (Default: MODE_EMA) -> Smoothing method for the slow Moving Average line (MA B) (Unit: ENUM_MA_METHOD).
- MA_B_Applied (Default: PRICE_CLOSE) -> Applied price source for the slow Moving Average line (MA B) (Unit: ENUM_APPLIED_PRICE).
- MA_B_Shift (Default: 0) -> Horizontal bar shift for the slow Moving Average line (MA B) (Unit: bars).
- Use_AO_Filter (Default: false) -> Enables or disables the Awesome Oscillator (AO) confirmation module (Unit: boolean true/false).
- Use_AO_Volume_Filter (Default: false) -> Requires the AO histogram value to reach minimum positive or negative amplitude levels (Unit: boolean true/false).
- AO_Buy_Min (Default: 4.0) -> Minimum positive AO reading required for BUY confirmation when Use_AO_Volume_Filter is active (Unit: AO oscillator units).
- AO_Sell_Max (Default: -4.0) -> Maximum negative AO threshold required for SELL confirmation when Use_AO_Volume_Filter is active (Unit: AO oscillator units).
- Use_AO_Color_Filter (Default: false) -> Requires ascending AO histogram slope for BUY signals and descending AO slope for SELL signals (Unit: boolean true/false).
- Use_AO_Zero_Filter (Default: false) -> Requires the AO histogram to be on the matching bullish (> 0) or bearish (< 0) side of the zero line with aligned momentum slope (Unit: boolean true/false).
- Use_SAR_Filter (Default: false) -> Enables or disables the Parabolic SAR directional dot filter (Unit: boolean true/false).
- SAR_Step (Default: 0.02) -> Acceleration factor step increment for Parabolic SAR (Unit: step increment).
- SAR_Maximum (Default: 0.2) -> Maximum acceleration factor limit for Parabolic SAR (Unit: factor cap).
- Use_HeikenAshi_Filter (Default: false) -> Enables or disables internal Heiken Ashi smoothed candle polarity confirmation (Unit: boolean true/false).
- Use_CCI_Filter (Default: false) -> Enables or disables the Commodity Channel Index (CCI) zero-line trend filter (Unit: boolean true/false).
- CCI_Period (Default: 50) -> Lookback period for the CCI zero-line trend filter (Unit: bars).
- CCI_Applied (Default: PRICE_CLOSE) -> Applied price source for the CCI zero-line trend filter (Unit: ENUM_APPLIED_PRICE).
- Use_CCI_OBOS_Filter (Default: false) -> Enables or disables the CCI momentum threshold filter (Unit: boolean true/false).
- CCI_OBOS_Period (Default: 14) -> Lookback period for the CCI momentum threshold filter (Unit: bars).
- CCI_OBOS_Applied (Default: PRICE_CLOSE) -> Applied price source for the CCI momentum threshold filter (Unit: ENUM_APPLIED_PRICE).
- CCI_Overbought (Default: 100.0) -> Upper CCI level threshold for bullish momentum confirmation (Unit: CCI index points).
- CCI_Oversold (Default: -100.0) -> Lower CCI level threshold for bearish momentum confirmation (Unit: CCI index points).
- Use_RVI_Filter (Default: false) -> Enables or disables the Relative Vigor Index (RVI) zero-line directional filter (Unit: boolean true/false).
- RVI_Period (Default: 75) -> Lookback period for the RVI zero-line trend filter (Unit: bars).
- Use_RVI_Signal_Filter (Default: false) -> Enables or disables the RVI main line versus signal line crossover alignment filter (Unit: boolean true/false).
- RVI_Signal_Period (Default: 20) -> Lookback period for the RVI signal line crossover module (Unit: bars).
- Use_MACD_Filter (Default: false) -> Enables or disables the MACD histogram polarity filter (Unit: boolean true/false).
- MACD_FastEMA (Default: 12) -> Fast EMA period for the MACD indicator (Unit: bars).
- MACD_SlowEMA (Default: 26) -> Slow EMA period for the MACD indicator (Unit: bars).
- MACD_SignalSMA (Default: 9) -> Signal line SMA period for the MACD indicator (Unit: bars).
- MACD_Applied (Default: PRICE_CLOSE) -> Applied price source for MACD calculations (Unit: ENUM_APPLIED_PRICE).
- Use_MACD_Zero_Filter (Default: false) -> Enables or disables the MACD main line zero-level regime filter (Unit: boolean true/false).
- Use_SR_Filter (Default: false) -> Enables or disables dynamic local Support and Resistance zone proximity filtering (Unit: boolean true/false).
- SR_Period (Default: 50) -> Historical bar window scanned to establish local Support and Resistance extremes (Unit: bars).
- SR_Zone_Points (Default: 80) -> Proximity tolerance zone around Support and Resistance levels within which a candle qualifies as testing the boundary (Unit: points).
- Use_Fib_Filter (Default: false) -> Enables or disables Fibonacci retracement zone confluence filtering based on recent swing pivots (Unit: boolean true/false).
- Fib_Level_1 (Default: 0.382) -> First Fibonacci retracement ratio boundary defining the active pullback zone (Unit: Fibonacci ratio).
- Fib_Level_2 (Default: 0.618) -> Second Fibonacci retracement ratio boundary defining the active pullback zone (Unit: Fibonacci ratio).
- ZigZag_Depth (Default: 12) -> Minimum bar depth required to identify swing highs and lows for Fibonacci anchoring (Unit: bars).
- ZigZag_Deviation (Default: 5) -> Minimum price deviation required between consecutive swing pivots (Unit: points).
- ZigZag_Backstep (Default: 3) -> Minimum bar separation between adjacent swing highs or lows (Unit: bars).
- Use_Supertrend_Filter (Default: false) -> Enables or disables the volatility-adjusted Supertrend directional regime filter (Unit: boolean true/false).
- ST_AtrPeriod (Default: 10) -> Wilder ATR smoothing period used to compute Supertrend bands (Unit: bars).
- ST_Factor (Default: 3.0) -> Volatility band multiplier applied to ATR in the Supertrend calculation (Unit: multiplier factor).
6. Risk Disclaimer
Trading foreign exchange, commodities, indices, and other leveraged financial instruments carries a high level of risk and may not be suitable for all investors. Past performance, historical chart observations, and backtesting results do not guarantee future trading outcomes. This indicator is an analytical and charting utility developed strictly to assist traders in visual market evaluation; it does not constitute financial advice, portfolio management, or any guarantee of profit. Always test the indicator thoroughly on a demo account to understand its operational behavior across varying market conditions before applying it to live trading decisions.
