Fractal Breakout Trend Confluence Multi Filter
- Indicadores
- Versão: 1.0
- Ativações: 5
Fractal Breakout Trend Confluence Multi Filter
1. Product Overview
- Fractal Breakout Multi Filter is a technical analysis indicator for MetaTrader 4 (MT4) designed to identify structural swing fractal breakouts validated through a modular 15-indicator confluence framework.
- The software operates directly within the main chart window, plotting directional signal arrows for wick-based and candle-body-based breakouts while projecting dynamic Average True Range (ATR) Stop Loss (SL) and three-tier Take Profit (TP1, TP2, TP3) reference levels.
- Built as a transparent technical workflow and chart-visualization utility, it consolidates swing structure tracking, multi-regime trend and momentum filtering, volatility-scaled risk mapping, and multi-channel notifications into a single MQL4 indicator.
- Traders can run the indicator as a pure price-action fractal breakout detector by leaving all filters disabled (default configuration), or configure a custom multi-confluence filter stack by enabling any combination of the 15 integrated analytical modules.
- All breakout evaluations, filter checks, and visual target projections are computed strictly on confirmed closed candles (Bar 1), providing stable historical chart signals without post-close recalculation.
2. Operating Principle and Signal Logic
- Swing Fractal Structure Detection: The core algorithm scans historical bar highs and lows using a symmetrical lookback window (InpFractalBars, default 2 bars on both the left and right sides) to detect confirmed swing high and swing low pivots.
- Closed-Bar Validation and Non-Repainting Behavior: A swing fractal pivot is recognized only after its right-side confirmation bars have fully closed, and breakout conditions are evaluated exclusively on completed bars (Bar 1). Active open-candle buffers (Bar 0) remain unplotted until bar closure, ensuring that historical arrows do not repaint, shift, or disappear.
- Dual Breakout Confirmation Modes:
- Signal 1 (Wick Breakout Mode): Evaluates whether a closed candle breaks beyond the extreme wick (High or Low) of the active swing fractal pivot, capturing early range expansion and structural level breaches.
- Signal 2 (Body Breakout Mode): Evaluates whether a closed candle breaks beyond the candle body boundary (Open or Close extreme) of the active swing fractal pivot, requiring stronger directional close commitment before plotting a signal.
- Bullish (Buy) Signal Generation Conditions:
- An active, unbroken upper swing fractal resistance level is present on the chart.
- The newly closed candle (Bar 1) confirms an upward breakout above the active fractal wick (triggering Buy Signal 1) or above the active fractal body (triggering Buy Signal 2).
- Every enabled module within the 15-filter confluence suite simultaneously validates bullish alignment on the evaluated signal bar.
- Bearish (Sell) Signal Generation Conditions:
- An active, unbroken lower swing fractal support level is present on the chart.
- The newly closed candle (Bar 1) confirms a downward breakout below the active fractal wick (triggering Sell Signal 1) or below the active fractal body (triggering Sell Signal 2).
- Every enabled module within the 15-filter confluence suite simultaneously validates bearish alignment on the evaluated signal bar.
- Active Level Lifecycle Management: Once an active swing fractal level triggers a confirmed breakout signal, that level is marked as consumed to prevent repetitive duplicate arrows on the same horizontal threshold until a subsequent swing fractal forms.
- Dynamic ATR Risk and Reward Projection: Upon confirming the latest signal on the chart, the indicator measures current market volatility using the ATR value on the signal bar (InpATRPeriod), scales it by InpATRMultiplier to define a 1R risk unit, and draws horizontal reference lines for Entry, SL (1R), TP1 (1R), TP2 (2R), and TP3 (3R).
3. Key Technical Features
- Modular 15-Filter Confluence Suite: Incorporates 15 independent technical filter modules covering trend direction, oscillator momentum, volatility regimes, and structural price zones, allowing granular control over signal frequency and market regime alignment.
- Four Independent Signal Buffers: Separates Buy Signal 1, Sell Signal 1, Buy Signal 2, and Sell Signal 2 into dedicated indicator buffers for distinct visual styling on the chart and direct integration via MQL4 iCustom calls.
- Real-Time Active Fractal Reference Lines: Displays horizontal dashed lines marking the current unbroken Fractal High and Fractal Low levels so traders can observe impending breakout boundaries directly on the price scale.
- Automated ATR SL and 3-Tier TP Visual Overlay: Projects Entry, SL, TP1 (1R), TP2 (2R), and TP3 (3R) trendline segments and price labels anchored to the latest confirmed signal bar, updating automatically whenever a newer valid breakout occurs.
- Self-Contained Heiken Ashi and Supertrend Calculations: Computes smoothed Heiken Ashi candle states and Wilder's RMA-based Supertrend bands internally without requiring external custom indicator files in the MQL4 Indicators folder.
- Structural Support/Resistance and Swing Fibonacci Filtering: Integrates historical lookback Support/Resistance zone proximity checks and swing-pivot Fibonacci retracement zone validation (default 38.2% to 61.8% retracement band) directly within the filter pipeline.
- Multi-Channel Closed-Bar Alert Dispatcher: Sends formatted notifications specifying direction, signal type, instrument symbol, timeframe, and trigger price via terminal pop-up dialogs, WAV audio files, mobile push notifications (MetaQuotes ID), and SMTP email—strictly once per newly closed bar.
- Automatic Broker Point Normalization: Scales arrow offsets, Support/Resistance zone tolerances, and swing deviation thresholds automatically for 2-, 3-, 4-, and 5-digit broker quotes across Forex, metals, and indices.
4. Graphical User Interface (GUI) and Visual Elements
- Aqua Upward Arrow (Wingdings Code 233): Plotted below the signal candle low when a bullish Wick Breakout (Buy Signal 1) satisfies all active filters.
- Red Downward Arrow (Wingdings Code 234): Plotted above the signal candle high when a bearish Wick Breakout (Sell Signal 1) satisfies all active filters.
- Dodger Blue Upward Arrow (Wingdings Code 233): Plotted below the signal candle low when a bullish Body Breakout (Buy Signal 2) satisfies all active filters.
- Orange-Red Downward Arrow (Wingdings Code 234): Plotted above the signal candle high when a bearish Body Breakout (Sell Signal 2) satisfies all active filters.
- Yellow Horizontal Dashed Line: Marks the active, unbroken Fractal High resistance level; updates automatically when a newer swing high is confirmed or when the level is breached.
- Aqua Horizontal Dashed Line: Marks the active, unbroken Fractal Low support level; updates automatically when a newer swing low is confirmed or when the level is breached.
- Gold Solid Trendline (BUY or SELL Label): Indicates the reference closing price of the latest confirmed breakout candle.
- Red Dashed Trendline (SL Label): Indicates the ATR-derived Stop Loss price level positioned at 1R distance from Entry.
- Lime Green, Medium Sea Green, and Dodger Blue Dashed Trendlines (TP1 (1R), TP2 (2R), TP3 (3R) Labels): Indicate progressive 1:1, 1:2, and 1:3 Risk-to-Reward target levels projected from the latest confirmed signal.
5. Operation, Setup Recommendations, and Performance
- Supported Instruments: Applicable to all liquid Forex currency pairs (such as EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD, EURJPY), spot precious metals (XAUUSD, XAGUSD), equity indices, and energy CFDs. Traders should verify broker spread characteristics and tick point values before live deployment.
- Recommended Timeframes:
- Scalping and Intraday (M5, M15): Recommended when paired with directional trend and volatility filters (such as Supertrend, ADX, or Double Moving Average) to filter out low-momentum range fluctuations.
- Day Trading (M30, H1): Balanced timeframe tier providing clear swing fractal structures and well-proportioned ATR Stop Loss and Take Profit distances.
- Swing Trading (H4, D1): Suitable for capturing multi-session structural breakouts with wider volatility-adjusted target projections.
- Account and Broker Environment: Compatible with both Hedging and Netting MetaTrader 4 accounts. Low-spread ECN accounts are recommended when applying tighter point tolerances (SR_Zone_Points) or operating on lower intraday timeframes.
- CPU and Memory Usage Guidelines: The indicator requires a minimum chart history of InpFractalBars * 2 + 100 bars to initialize calculations. Buffer processing is optimized inside OnCalculate to keep resource consumption low; however, when activating multiple filters simultaneously across many open charts, traders should avoid opening excessive chart windows on systems with limited RAM or CPU capacity.
6. Complete Input Parameters Documentation
- Core Signal, Arrow, Fractal, and Visual Settings:
- InpGroupSignal (Default: "=== Signal Settings ==="): Visual group divider label for core breakout signal toggles (text string).
- InpEnableSignal1 (Default: true): Enables or disables Signal 1 evaluation based on fractal wick breakouts (boolean: true/false).
- InpEnableSignal2 (Default: true): Enables or disables Signal 2 evaluation based on fractal candle-body breakouts (boolean: true/false).
- InpGroupArrow (Default: "=== Arrow Settings ==="): Visual group divider label for chart arrow display settings (text string).
- InpArrowDistance (Default: 30): Vertical spacing offset between signal arrows and candle high/low extremes (measured in broker points).
- InpArrowSize (Default: 2): Visual width/size of plotted signal arrows on the chart (integer scale from 1 to 5).
- InpGroupFractal (Default: "=== Fractal Settings ==="): Visual group divider label for swing fractal structure parameters (text string).
- InpFractalBars (Default: 2): Number of confirmation bars required on both left and right sides of a swing pivot bar (measured in bars; standard fractal equals 2).
- InpGroupVisual (Default: "=== Visual Settings ==="): Visual group divider label for active fractal level lines (text string).
- InpShowFractalLines (Default: true): Toggles visibility of horizontal lines marking active unbroken fractal high and low levels (boolean: true/false).
- InpColorFractalHigh (Default: clrYellow): Display color of the horizontal line representing the active upper fractal resistance level (color value).
- InpColorFractalLow (Default: clrAqua): Display color of the horizontal line representing the active lower fractal support level (color value).
- InpLineWidth (Default: 1): Line thickness for active fractal horizontal lines (measured in pixels).
- InpLineStyle (Default: STYLE_DASH): Drawing line pattern for active fractal horizontal lines (enumeration: solid, dash, dot, dashdot, dashdotdot).
- ATR and Target Levels (SL/TP) Settings:
- InpGroupSLTP (Default: "=== ATR & Target Levels (SL/TP) ==="): Visual group divider label for ATR volatility risk-reward projections (text string).
- InpShowSLTP (Default: true): Toggles visibility of Entry, SL, TP1, TP2, and TP3 lines and labels for the latest confirmed signal (boolean: true/false).
- InpATRPeriod (Default: 7): Lookback period used to compute the Average True Range volatility baseline (measured in bars).
- InpATRMultiplier (Default: 1.5): Multiplication factor applied to the ATR value to establish the 1R Stop Loss distance (floating-point multiplier).
- InpLineExtendBars (Default: 1): Number of bar intervals to extend Entry, SL, and TP lines to the right of Bar 0 (measured in bars).
- InpFontSize (Default: 8): Text font size for Entry, SL, TP1, TP2, and TP3 price labels (measured in font points).
- InpColorEntry (Default: clrGold): Line and text label color for the reference Entry price level (color value).
- InpColorSL (Default: clrRed): Line and text label color for the Stop Loss (1R) boundary (color value).
- InpColorTP1 (Default: clrLimeGreen): Line and text label color for the first Take Profit target at 1:1 Risk-to-Reward (color value).
- InpColorTP2 (Default: clrMediumSeaGreen): Line and text label color for the second Take Profit target at 1:2 Risk-to-Reward (color value).
- InpColorTP3 (Default: clrDodgerBlue): Line and text label color for the third Take Profit target at 1:3 Risk-to-Reward (color value).
- InpTargetLineStyle (Default: STYLE_DASH): Drawing line style for SL, TP1, TP2, and TP3 projection lines (enumeration).
- InpTargetLineWidth (Default: 1): Line thickness for Entry, SL, and TP projection lines (measured in pixels).
- Alert and Notification Settings:
- InpGroupAlert (Default: "=== Alert & Notification ==="): Visual group divider label for multi-channel alert toggles (text string).
- InpAlertPopup (Default: true): Enables or disables pop-up alert dialog windows inside the MT4 terminal on new closed-bar signals (boolean: true/false).
- InpAlertSound (Default: true): Enables or disables audible WAV sound alerts upon signal confirmation (boolean: true/false).
- InpAlertSoundFile (Default: "alert.wav"): Filename of the audio file located inside the MetaTrader Sounds directory (text string).
- InpAlertPush (Default: true): Enables or disables push notifications sent to the mobile MetaTrader app via MetaQuotes ID (boolean: true/false).
- InpAlertEmail (Default: false): Enables or disables email alerts dispatched through the terminal's configured SMTP mail server (boolean: true/false).
- Filter 1 - RSI Cross Filter Parameters:
- InpFilter1 (Default: "=== 1. RSI CROSS FILTER ==="): Visual group divider label for the RSI threshold crossover filter (text string).
- Use_RSI_Cross_Filter (Default: false): Enables or disables Relative Strength Index (RSI) oversold/overbought crossover confirmation (boolean: true/false).
- RSI_Length (Default: 14): Lookback period for RSI calculation (measured in bars).
- RSI_Price_Source (Default: PRICE_CLOSE): Applied candle price series used for RSI computation (enumeration: Close, Open, High, Low, Median, Typical, Weighted).
- RSI_Oversold (Default: 30.0): Lower RSI threshold boundary for bullish crossover validation (index scale 0.0 to 100.0).
- RSI_Overbought (Default: 70.0): Upper RSI threshold boundary for bearish crossover validation (index scale 0.0 to 100.0).
- Filter 2 - ADX Trend Strength Filter Parameters:
- InpFilter2 (Default: "=== 2. ADX FILTER ==="): Visual group divider label for the Average Directional Index (ADX) filter (text string).
- Use_ADX_Filter (Default: false): Enables or disables minimum directional trend strength validation via ADX (boolean: true/false).
- ADX_Period (Default: 10): Lookback period for ADX main line calculation (measured in bars).
- ADX_Min_Level (Default: 20.0): Minimum ADX main line value required to permit breakout signals (index scale).
- Filter 3 - Single Moving Average Filter Parameters:
- InpFilter3 (Default: "=== 3. SINGLE MA FILTER ==="): Visual group divider label for the Single Moving Average trend baseline filter (text string).
- Use_MA_Filter (Default: false): Enables or disables closing price alignment above or below a single Moving Average (boolean: true/false).
- MA_Period (Default: 50): Averaging lookback period for the Moving Average (measured in bars).
- MA_Method (Default: MODE_SMA): Moving Average smoothing algorithm (enumeration: SMA, EMA, SMMA, LWMA).
- MA_Shift (Default: 0): Horizontal displacement of the Moving Average line (measured in bars).
- Filter 4 - Ichimoku Senkou Span B Filter Parameters:
- InpFilter4 (Default: "=== 4. ICHIMOKU SENKOU SPAN B FILTER ==="): Visual group divider label for the Ichimoku Kinko Hyo baseline filter (text string).
- Use_Ichimoku_Filter (Default: false): Enables or disables price positioning confirmation relative to Ichimoku Senkou Span B (boolean: true/false).
- Ichimoku_Tenkan (Default: 9): Tenkan-sen (Conversion Line) calculation period (measured in bars).
- Ichimoku_Kijun (Default: 26): Kijun-sen (Base Line) calculation period (measured in bars).
- Ichimoku_SenkouB (Default: 52): Senkou Span B (Leading Span B) calculation period (measured in bars).
- Filter 5 - RSI 75 Macro Equilibrium Filter Parameters:
- InpFilter5 (Default: "=== 5. RSI 75 FILTER ==="): Visual group divider label for the long-period RSI equilibrium filter (text string).
- Use_RSI75_Filter (Default: false): Enables or disables macro momentum alignment around the 50.0 RSI midpoint (boolean: true/false).
- RSI_Filter_Period (Default: 75): Lookback period for the macro RSI trend filter (measured in bars).
- Filter 6 - Double Moving Average Alignment Filter Parameters:
- InpFilter6 (Default: "=== 6. DOUBLE MA FILTER ==="): Visual group divider label for the dual Moving Average trend alignment filter (text string).
- Use_DoubleMA_Filter (Default: false): Enables or disables directional alignment check between Fast MA (A) and Slow MA (B) (boolean: true/false).
- MA_A_Period (Default: 30): Averaging period for the faster Moving Average A (measured in bars).
- MA_A_Method (Default: MODE_EMA): Smoothing method for Moving Average A (enumeration: SMA, EMA, SMMA, LWMA).
- MA_A_Applied (Default: PRICE_CLOSE): Applied candle price type for Moving Average A (enumeration).
- MA_A_Shift (Default: 0): Horizontal bar shift for Moving Average A (measured in bars).
- MA_B_Period (Default: 140): Averaging period for the slower Moving Average B (measured in bars).
- MA_B_Method (Default: MODE_EMA): Smoothing method for Moving Average B (enumeration: SMA, EMA, SMMA, LWMA).
- MA_B_Applied (Default: PRICE_CLOSE): Applied candle price type for Moving Average B (enumeration).
- MA_B_Shift (Default: 0): Horizontal bar shift for Moving Average B (measured in bars).
- Filter 7 - Awesome Oscillator (AO) Filter Parameters:
- InpFilter7 (Default: "=== 7. AWESOME OSCILLATOR FILTER ==="): Visual group divider label for the Awesome Oscillator filter module (text string).
- Use_AO_Filter (Default: false): Master toggle to activate Awesome Oscillator filtering sub-conditions (boolean: true/false).
- Use_AO_Volume_Filter (Default: false): Enables minimum positive/negative AO histogram amplitude checks (boolean: true/false).
- AO_Buy_Min (Default: 4.0): Minimum positive AO histogram threshold required for bullish signals when amplitude filtering is active (oscillator units).
- AO_Sell_Max (Default: -4.0): Maximum negative AO histogram threshold required for bearish signals when amplitude filtering is active (oscillator units).
- Use_AO_Color_Filter (Default: false): Requires bar-over-bar AO histogram slope momentum (rising histogram for buy, falling for sell) (boolean: true/false).
- Use_AO_Zero_Filter (Default: false): Requires AO histogram alignment above zero for buy or below zero for sell combined with matching slope direction (boolean: true/false).
- Filter 8 - Parabolic SAR Filter Parameters:
- InpFilter8 (Default: "=== 8. PARABOLIC SAR FILTER ==="): Visual group divider label for the Parabolic Stop and Reverse (SAR) filter (text string).
- Use_SAR_Filter (Default: false): Enables or disables Parabolic SAR directional price alignment (boolean: true/false).
- SAR_Step (Default: 0.02): Acceleration factor step increment for Parabolic SAR calculation (floating-point step).
- SAR_Maximum (Default: 0.2): Maximum acceleration factor ceiling for Parabolic SAR (floating-point cap).
- Filter 9 - Heiken Ashi Candle Filter Parameters:
- InpFilter9 (Default: "=== 9. HEIKEN ASHI FILTER ==="): Visual group divider label for the smoothed Heiken Ashi polarity filter (text string).
- Use_HeikenAshi_Filter (Default: false): Enables or disables smoothed Heiken Ashi candle polarity confirmation (bullish close above open for buy, bearish close below open for sell) (boolean: true/false).
- Filter 10 - CCI Trend Filter Parameters:
- InpFilter10 (Default: "=== 10. CCI TREND FILTER ==="): Visual group divider label for the Commodity Channel Index (CCI) zero-line trend filter (text string).
- Use_CCI_Filter (Default: false): Enables or disables CCI zero-line directional bias confirmation (boolean: true/false).
- CCI_Period (Default: 50): Lookback period for the CCI trend calculation (measured in bars).
- CCI_Applied (Default: PRICE_CLOSE): Applied candle price source for the CCI trend filter (enumeration).
- Filter 11 - CCI Overbought and Oversold Filter Parameters:
- InpFilter11 (Default: "=== 11. CCI OB & OS FILTER ==="): Visual group divider label for the CCI extreme momentum threshold filter (text string).
- Use_CCI_OBOS_Filter (Default: false): Enables or disables CCI upper and lower threshold breakout confirmation (boolean: true/false).
- CCI_OBOS_Period (Default: 14): Lookback period for the short-term CCI momentum calculation (measured in bars).
- CCI_OBOS_Applied (Default: PRICE_CLOSE): Applied candle price source for the CCI OB/OS filter (enumeration).
- CCI_Overbought (Default: 100.0): Upper CCI threshold boundary (oscillator index units).
- CCI_Oversold (Default: -100.0): Lower CCI threshold boundary (oscillator index units).
- Filter 12 - Relative Vigor Index (RVI) Filters Parameters:
- InpFilter12 (Default: "=== 12. RVI FILTERS ==="): Visual group divider label for the Relative Vigor Index (RVI) modules (text string).
- Use_RVI_Filter (Default: false): Enables or disables macro RVI zero-line directional filtering (boolean: true/false).
- RVI_Period (Default: 75): Lookback period for the macro RVI zero-line filter (measured in bars).
- Use_RVI_Signal_Filter (Default: false): Enables or disables RVI Main line vs. Signal line crossover alignment (boolean: true/false).
- RVI_Signal_Period (Default: 20): Lookback period for the RVI Main and Signal line calculation (measured in bars).
- Filter 13 - MACD Histogram and Zero-Line Filters Parameters:
- InpFilter13 (Default: "=== 13. MACD FILTERS ==="): Visual group divider label for the Moving Average Convergence Divergence (MACD) modules (text string).
- Use_MACD_Filter (Default: false): Enables or disables MACD histogram polarity filtering (Main line relative to Signal line) (boolean: true/false).
- MACD_FastEMA (Default: 12): Fast Exponential Moving Average period for MACD calculation (measured in bars).
- MACD_SlowEMA (Default: 26): Slow Exponential Moving Average period for MACD calculation (measured in bars).
- MACD_SignalSMA (Default: 9): Signal line Simple Moving Average smoothing period for MACD (measured in bars).
- MACD_Applied (Default: PRICE_CLOSE): Applied candle price source for MACD calculation (enumeration).
- Use_MACD_Zero_Filter (Default: false): Enables or disables MACD Main line zero-axis directional alignment (boolean: true/false).
- Filter 14 - Support/Resistance and Fibonacci Retracement Filters Parameters:
- InpFilter14 (Default: "=== 14. SR & FIBONACCI FILTERS ==="): Visual group divider label for structural Support/Resistance and Fibonacci zone filters (text string).
- Use_SR_Filter (Default: false): Enables or disables historical Support and Resistance zone proximity validation (boolean: true/false).
- SR_Period (Default: 50): Lookback window used to detect recent structural high and low boundaries (measured in bars).
- SR_Zone_Points (Default: 80): Proximity buffer around detected Support/Resistance levels (measured in broker points).
- Use_Fib_Filter (Default: false): Enables or disables swing-based Fibonacci retracement zone validation (boolean: true/false).
- Fib_Level_1 (Default: 0.382): First Fibonacci retracement ratio boundary (decimal ratio: 38.2%).
- Fib_Level_2 (Default: 0.618): Second Fibonacci retracement ratio boundary (decimal ratio: 61.8%).
- ZigZag_Depth (Default: 12): Minimum lookback depth used to identify swing pivot highs and lows for Fibonacci anchoring (measured in bars).
- ZigZag_Deviation (Default: 5): Minimum price deviation required to validate a new swing pivot (measured in broker points).
- ZigZag_Backstep (Default: 3): Minimum bar spacing enforced between consecutive swing pivots (measured in bars).
- Filter 15 - Supertrend Volatility Filter Parameters:
- InpFilter15 (Default: "=== 15. SUPERTREND FILTER ==="): Visual group divider label for the ATR-based Supertrend regime filter (text string).
- Use_Supertrend_Filter (Default: false): Enables or disables Supertrend directional trend regime alignment (boolean: true/false).
- ST_AtrPeriod (Default: 10): ATR lookback length used to calculate Supertrend volatility bands (measured in bars).
- ST_Factor (Default: 3.0): Volatility multiplier applied to ATR to compute upper and lower Supertrend band offsets (floating-point multiplier).
7. Risk Disclaimer
- Trading foreign exchange, commodities, indices, and other financial instruments carries a high level of risk and may not be suitable for all investors. Past performance and historical chart signals are not indicative of future results. This software is a technical analysis and charting utility designed to assist traders in evaluating price action; it does not constitute financial advice and does not promise or ensure financial profit. Always test the indicator thoroughly on a demo account to understand its operational behavior and parameter interactions before considering use in a live trading environment.
