Candlestick Pin Bar Rejection Marubozu MultiFilter
- Göstergeler
- Sürüm: 1.0
- Etkinleştirmeler: 5
Candlestick Pin Bar Rejection Marubozu MultiFilter
1. Overview
- Multi-Pattern Price Action and Multi-Filter Indicator for MetaTrader 4 (MT4) is a technical chart-window analytical tool engineered to identify high-probability candlestick formations and validate them through a modular 15-filter confirmation architecture.
- The indicator integrates three established price action detection engines—Pin Bar, Candle Rejection, and Full-Body Marubozu—into a unified signal pipeline paired with an automated Average True Range (ATR) Stop Loss (SL) and Take Profit (TP) level visualizer.
- Designed for discretionary price action traders and systematic technical analysts, the tool eliminates manual chart scanning by plotting non-repainting directional arrows on closed bars and projecting dynamic 1R, 2R, and 3R risk-to-reward reference levels directly on the price chart.
- All confirmation filters operate independently as modular switches, allowing traders to deploy pure candlestick price action signals or enforce multi-indicator confluence across trend, momentum, volatility, and structural support/resistance dimensions.
2. Technical Operating Principle
- Three-Pattern Candlestick Geometry Engine: On every completed bar, the indicator evaluates open, high, low, and close price geometry to classify directional candlestick structures according to the active selection mode in InpEntryMethod.
- Pin Bar Detection Logic: Evaluates candlestick wick asymmetry to detect formations where a prominent rejection tail protrudes significantly beyond both the opposing nose wick and the real candle body, signaling intrabar liquidity rejection and directional reversal pressure.
- Candle Rejection Detection Logic: Identifies price exhaustion candles featuring an elongated rejection shadow, a tightly constrained opposing wick, and a compact real body relative to total bar range, with optional directional close-color confirmation via RequireBullishBody and RequireBearishBody.
- Full-Body Marubozu Detection Logic: Detects decisive momentum candles whose real body spans virtually the entire high-to-low range with negligible upper and lower wicks, reflecting sustained institutional order flow and directional breakout conviction.
- Sequential Multi-Filter Confluence Gate: Every candidate candlestick pattern is routed through the integrated 15-module filter framework (CFAZAFILTER). Filters operate using strict logical conjunction (AND logic), meaning a signal is approved only when every enabled filter module simultaneously confirms the trade direction.
- BUY Signal Generation Condition: A BUY signal arrow is plotted below the candle low when a valid bullish candlestick formation (Bullish Pin Bar, Bullish Candle Rejection, or Bullish Marubozu) completes on a closed bar and passes all currently active confirmation filters.
- SELL Signal Generation Condition: A SELL signal arrow is plotted above the candle high when a valid bearish candlestick formation (Bearish Pin Bar, Bearish Candle Rejection, or Bearish Marubozu) completes on a closed bar and passes all currently active confirmation filters.
- Closed-Bar Calculation and Non-Repainting Behavior: All pattern evaluations and filter checks execute strictly on closed, completed candles (Bar 1 and historical bars). The active unclosed candle (Bar 0) is continuously cleared from signal buffers until candle close, ensuring that once an arrow is plotted on a closed bar, it does not repaint, shift, or disappear.
- Dynamic ATR Risk-Reward Target Projection: Upon identifying the most recent confirmed signal on the chart, the indicator reads the ATR value at that signal bar, multiplies it by ATR_Multiplier_SL to define one unit of risk (1R), and draws horizontal reference lines for Entry, Stop Loss (1R), TP1 (1R), TP2 (2R), and TP3 (3R).
3. Key Features and Modular Filter Suite
- Five Selectable Pattern Operating Modes: Switch seamlessly between Combined Rejection + Marubozu, Candle Rejection Only, Full-Body Marubozu Only, Pin Bar Only, or All Three Patterns Combined without attaching multiple indicators.
- Modular 15-Filter Confirmation Framework: Incorporates 15 built-in technical confirmation filters covering trend direction, trend strength, oscillator momentum, volatility bands, and structural price zones.
- Dynamic ATR Target Visualizer: Automatically plots Entry, SL, and three progressive Reward-to-Risk Take Profit levels (1R, 2R, 3R) with live price tags for rapid trade planning and visual risk assessment.
- Multi-Channel Real-Time Alert System: Supports terminal pop-up dialog alerts, customizable audio alerts, mobile push notifications via MetaQuotes ID, and SMTP email notifications upon closed-bar signal confirmation.
- Filter 1 — RSI Crossover Filter (Use_RSI_Cross_Filter): Validates reversal timing by requiring the Relative Strength Index to cross upward out of the oversold zone for BUY signals or downward out of the overbought zone for SELL signals.
- Filter 2 — ADX Trend Strength Filter (Use_ADX_Filter): Filters out low-volatility ranging markets by requiring the Average Directional Index main line to meet or exceed ADX_Min_Level before approving signals.
- Filter 3 — Single Moving Average Filter (Use_MA_Filter): Enforces macro directional alignment by requiring the closing price to remain above a configurable Moving Average for BUY signals and below it for SELL signals.
- Filter 4 — Ichimoku Senkou Span B Filter (Use_Ichimoku_Filter): Uses the Ichimoku Kumo baseline (Senkou Span B) as a structural equilibrium filter, permitting BUY signals only above Senkou Span B and SELL signals only below it.
- Filter 5 — Long-Period RSI Bias Filter (Use_RSI75_Filter): Evaluates broader directional momentum using an extended-period RSI relative to the 50.0 midpoint threshold (above 50.0 for BUY, below 50.0 for SELL).
- Filter 6 — Double Moving Average Alignment Filter (Use_DoubleMA_Filter): Confirms trend structure by verifying that the fast Moving Average (MA A) is positioned above the slow Moving Average (MA B) for BUY setups and below it for SELL setups.
- Filter 7 — Awesome Oscillator Multi-Mode Filter (Use_AO_Filter): Offers three configurable Bill Williams Awesome Oscillator sub-conditions: minimum histogram amplitude thresholds, bar-over-bar momentum slope/color direction, and zero-line polarity alignment.
- Filter 8 — Parabolic SAR Directional Filter (Use_SAR_Filter): Validates active trend trailing structure by requiring price to close above Parabolic SAR dots for BUY signals and below Parabolic SAR dots for SELL signals.
- Filter 9 — Heiken Ashi Polarity Filter (Use_HeikenAshi_Filter): Smooths intrabar price noise by confirming that the corresponding smoothed Heiken Ashi candle closes bullish for BUY signals and bearish for SELL signals.
- Filter 10 — CCI Trend Zero-Line Filter (Use_CCI_Filter): Confirms medium-term cyclical trend direction by checking that the Commodity Channel Index is positive for BUY signals and negative for SELL signals.
- Filter 11 — CCI Overbought and Oversold Filter (Use_CCI_OBOS_Filter): Validates strong momentum thrust by checking CCI positioning relative to configurable upper and lower index thresholds.
- Filter 12 — RVI Trend and Signal Crossover Filter (Use_RVI_Filter, Use_RVI_Signal_Filter): Measures closing price vigor via the Relative Vigor Index, supporting both long-period zero-line bias confirmation and main-versus-signal line directional alignment.
- Filter 13 — MACD Histogram and Zero-Line Filter (Use_MACD_Filter, Use_MACD_Zero_Filter): Provides dual MACD trend confirmation through histogram momentum polarity (MACD main minus signal line) and main-line positioning relative to the zero axis.
- Filter 14 — Dynamic Support/Resistance and Fibonacci Filter (Use_SR_Filter, Use_Fib_Filter): Validates structural trade location by checking whether price interacts with recent swing Support/Resistance zones or active swing-derived Fibonacci retracement bands.
- Filter 15 — ATR-Based Supertrend Regime Filter (Use_Supertrend_Filter): Integrates a Wilder ATR-based Supertrend regime tracker that permits BUY signals strictly during bullish uptrend regimes and SELL signals strictly during bearish downtrend regimes.
4. Graphical Interface and Alert System
- Signal Arrows on Main Chart: Confirmed BUY setups display an upward Wingdings arrow (default code 233, Aqua color) positioned below the signal candle low by ArrowDistance points. Confirmed SELL setups display a downward Wingdings arrow (default code 234, Red color) positioned above the signal candle high by ArrowDistance points.
- ATR Target Level Lines and Labels: When Show_SLTP_Lines is enabled, five horizontal trend-line segments and right-anchored text labels appear from the latest confirmed signal bar to Line_Extend_Bars past candle 0: Entry (default Gold solid line), SL (default Red dashed line), TP1 at 1R (default Lime Green dashed line), TP2 at 2R (default Medium Sea Green dashed line), and TP3 at 3R (default Dodger Blue dashed line).
- Automatic Chart Object Cleanup: Removing the indicator or switching timeframes cleanly releases internal memory buffers and deletes all generated target lines and text objects without leaving residual graphics on the chart.
- Structured Alert Messages: Whenever a new confirmed signal closes on Bar 1, active notification channels broadcast a standardized message containing trade direction, detected pattern name, symbol name, and chart timeframe (for example: BUY Rejection + Marubozu (Confirmed) | EURUSD | PERIOD_H1).
5. Usage Recommendations and Terminal Performance
- Recommended Instruments: Suitable for major and minor Forex currency pairs (such as EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD), spot gold (XAUUSD), major stock indices, and liquid CFDs. Traders should account for broker spread characteristics when configuring point-based parameters.
- Recommended Timeframes: Compatible with all standard MT4 timeframes. M15 and M30 timeframes suit active intraday trading, H1 and H4 offer balanced structural clarity with reduced candlestick noise, and D1 is suited for swing position analysis.
- Account and Execution Environment: Compatible with both Hedging and Netting MT4 account types. Low-spread ECN accounts are recommended so that point-based visual offsets and Support/Resistance zone tolerances align closely with raw market pricing.
- Computational Efficiency and Resource Management: Historical bar processing is bounded to prevent redundant recalculation across deep chart histories, and all 15 confirmation filters are disabled (false) by default so inactive modules consume zero CPU overhead. When enabling multiple oscillator and swing-detection filters simultaneously across many open charts, avoid running an excessive number of chart instances on terminals with limited CPU or RAM capacity.
6. Input Parameters Documentation
Note: String inputs prefixed with InpGroup or InpFilter serve strictly as visual category dividers inside the MT4 Inputs tab and require no user adjustment.
Group 1: Entry Method Selection
- InpEntryMethod (Default: ENTRY_REJECTION_MARUBOZU) - Selects the active candlestick pattern detection mode: Candle Rejection + Marubozu, Candle Rejection Only, Full Candle (Marubozu) Only, PinBar Only, or All Patterns Combined (enumeration mode).
Group 2: Candle Rejection Settings
- WickToBodyRatio (Default: 2.5) - Minimum required length ratio of the dominant rejection wick relative to the real candle body (ratio multiplier).
- MaxOppositeWick (Default: 0.4) - Maximum allowable length ratio of the opposing wick relative to the real candle body (ratio multiplier).
- MaxBodyPercent (Default: 0.30) - Maximum allowable candle body size as a proportion of the total high-to-low candle range (0.0 to 1.0 decimal ratio).
- RequireBullishBody (Default: false) - Requires a bullish closing candle (close above open) to validate a bullish rejection signal (true/false boolean).
- RequireBearishBody (Default: false) - Requires a bearish closing candle (close below open) to validate a bearish rejection signal (true/false boolean).
Group 3: PinBar Detection Settings
- PinBarRatio (Default: 2.0) - Minimum required length ratio of the protruding tail wick relative to the opposite nose wick (ratio multiplier).
- BodyRatio (Default: 1.0) - Minimum required length ratio of the protruding tail wick relative to the real candle body (ratio multiplier).
Group 4: Visual and Arrow Settings
- ArrowCodeBuy (Default: 233) - Wingdings font character code used to render BUY signal arrows on the chart (integer symbol code).
- ArrowCodeSell (Default: 234) - Wingdings font character code used to render SELL signal arrows on the chart (integer symbol code).
- ArrowDistance (Default: 80) - Vertical spacing distance between the candle high/low and the plotted signal arrow (in broker points).
Group C: ATR and Target Levels (SL/TP)
- Show_SLTP_Lines (Default: true) - Enables or disables plotting Entry, Stop Loss, and Take Profit reference lines and price tags on the chart (true/false boolean).
- ATR_Period (Default: 7) - Lookback period used to compute the Average True Range volatility baseline on the signal bar (in bars).
- ATR_Multiplier_SL (Default: 1.5) - Volatility multiplier applied to ATR to calculate the Stop Loss risk distance (1R) and 1R/2R/3R targets (multiplier).
- Line_Extend_Bars (Default: 1) - Number of bars to extend horizontal target lines to the right of the current bar (in bars).
- Label_Font_Size (Default: 8) - Font size used for price text labels displayed next to the Entry, SL, and TP lines (in font points).
- Color_Entry (Default: clrGold) - Display color for the Entry price line and label (color value).
- Color_SL (Default: clrRed) - Display color for the Stop Loss reference line and label (color value).
- Color_TP1 (Default: clrLimeGreen) - Display color for the TP1 (1R) reference line and label (color value).
- Color_TP2 (Default: clrMediumSeaGreen) - Display color for the TP2 (2R) reference line and label (color value).
- Color_TP3 (Default: clrDodgerBlue) - Display color for the TP3 (3R) reference line and label (color value).
- Target_Line_Style (Default: STYLE_DASH) - Line drawing style applied to SL and TP horizontal lines (Solid, Dash, Dot, Dashdot, Dashdotdot).
- Line_Width (Default: 1) - Thickness of the plotted Entry, SL, and TP horizontal lines (in pixels, 1 to 5).
Group 5: Alerts and Notifications
- EnablePopupAlert (Default: true) - Enables or disables standard MetaTrader terminal pop-up alert windows on signal confirmation (true/false boolean).
- EnableSound (Default: true) - Enables or disables playing an audio alert file when a confirmed signal occurs (true/false boolean).
- SoundFile (Default: "alert2.wav") - Name of the audio file located in the MetaTrader Sounds directory used for sound alerts (text string).
- EnablePushNotification (Default: true) - Enables or disables sending push notifications to the MetaTrader mobile app via MetaQuotes ID (true/false boolean).
- EnableEmailAlert (Default: false) - Enables or disables sending signal alert emails via configured terminal SMTP settings (true/false boolean).
Filter Module 1: RSI Cross Filter
- Use_RSI_Cross_Filter (Default: false) - Enables or disables the RSI threshold crossover confirmation filter (true/false boolean).
- RSI_Length (Default: 14) - Calculation lookback period for the Relative Strength Index (in bars).
- RSI_Price_Source (Default: PRICE_CLOSE) - Applied price series used for RSI calculation (Close, Open, High, Low, Median, Typical, Weighted).
- RSI_Oversold (Default: 30.0) - Lower RSI threshold level required for upward bullish crossover validation (0.0 to 100.0 oscillator scale).
- RSI_Overbought (Default: 70.0) - Upper RSI threshold level required for downward bearish crossover validation (0.0 to 100.0 oscillator scale).
Filter Module 2: ADX Trend Strength Filter
- Use_ADX_Filter (Default: false) - Enables or disables the Average Directional Index trend-strength filter (true/false boolean).
- ADX_Period (Default: 10) - Lookback period used to compute the ADX main trend-strength line (in bars).
- ADX_Min_Level (Default: 20.0) - Minimum required ADX value confirming active trend strength before allowing signals (0.0 to 100.0 index scale).
Filter Module 3: Single Moving Average Filter
- Use_MA_Filter (Default: false) - Enables or disables price-versus-Moving-Average trend alignment filtering (true/false boolean).
- MA_Period (Default: 50) - Averaging period for the baseline Moving Average filter (in bars).
- MA_Method (Default: MODE_SMA) - Smoothing algorithm applied to the baseline Moving Average (SMA, EMA, SMMA, LWMA).
- MA_Shift (Default: 0) - Horizontal bar shift offset applied to the baseline Moving Average (in bars).
Filter Module 4: Ichimoku Senkou Span B Filter
- Use_Ichimoku_Filter (Default: false) - Enables or disables Kumo baseline filtering against Ichimoku Senkou Span B (true/false boolean).
- Ichimoku_Tenkan (Default: 9) - Tenkan-sen (Conversion Line) calculation period (in bars).
- Ichimoku_Kijun (Default: 26) - Kijun-sen (Base Line) calculation period (in bars).
- Ichimoku_SenkouB (Default: 52) - Senkou Span B (Leading Span B) calculation period (in bars).
Filter Module 5: Long-Period RSI Bias Filter
- Use_RSI75_Filter (Default: false) - Enables or disables macro momentum bias filtering around the RSI 50.0 midpoint (true/false boolean).
- RSI_Filter_Period (Default: 75) - Extended lookback period for the macro RSI bias filter (in bars).
Filter Module 6: Double Moving Average Filter
- Use_DoubleMA_Filter (Default: false) - Enables or disables dual Moving Average trend alignment filtering (true/false boolean).
- MA_A_Period (Default: 30) - Averaging period for the fast Moving Average (in bars).
- MA_A_Method (Default: MODE_EMA) - Smoothing algorithm for the fast Moving Average (SMA, EMA, SMMA, LWMA).
- MA_A_Applied (Default: PRICE_CLOSE) - Applied price source for the fast Moving Average calculation.
- MA_A_Shift (Default: 0) - Horizontal bar shift offset for the fast Moving Average (in bars).
- MA_B_Period (Default: 140) - Averaging period for the slow Moving Average (in bars).
- MA_B_Method (Default: MODE_EMA) - Smoothing algorithm for the slow Moving Average (SMA, EMA, SMMA, LWMA).
- MA_B_Applied (Default: PRICE_CLOSE) - Applied price source for the slow Moving Average calculation.
- MA_B_Shift (Default: 0) - Horizontal bar shift offset for the slow Moving Average (in bars).
Filter Module 7: Awesome Oscillator Filter
- Use_AO_Filter (Default: false) - Enables or disables the Bill Williams Awesome Oscillator confirmation module (true/false boolean).
- Use_AO_Volume_Filter (Default: false) - Enforces minimum positive/negative AO amplitude thresholds when AO filtering is active (true/false boolean).
- AO_Buy_Min (Default: 4.0) - Minimum positive AO histogram value required for BUY confirmation (oscillator value).
- AO_Sell_Max (Default: -4.0) - Maximum negative AO histogram value required for SELL confirmation (oscillator value).
- Use_AO_Color_Filter (Default: false) - Requires rising AO histogram momentum bar-over-bar for BUY and falling AO for SELL (true/false boolean).
- Use_AO_Zero_Filter (Default: false) - Requires AO momentum alignment above zero for BUY and below zero for SELL (true/false boolean).
Filter Module 8: Parabolic SAR Filter
- Use_SAR_Filter (Default: false) - Enables or disables Parabolic Stop-and-Reverse directional trend filtering (true/false boolean).
- SAR_Step (Default: 0.02) - Acceleration factor increment step for Parabolic SAR computation (decimal step value).
- SAR_Maximum (Default: 0.2) - Maximum acceleration factor cap for Parabolic SAR computation (decimal cap value).
Filter Module 9: Heiken Ashi Filter
- Use_HeikenAshi_Filter (Default: false) - Enables or disables smoothed Heiken Ashi candle polarity confirmation (true/false boolean).
Filter Module 10: CCI Trend Filter
- Use_CCI_Filter (Default: false) - Enables or disables Commodity Channel Index zero-line directional filtering (true/false boolean).
- CCI_Period (Default: 50) - Lookback period for the directional CCI trend filter (in bars).
- CCI_Applied (Default: PRICE_CLOSE) - Applied price source for the directional CCI calculation.
Filter Module 11: CCI Overbought and Oversold Filter
- Use_CCI_OBOS_Filter (Default: false) - Enables or disables short-term CCI threshold momentum confirmation (true/false boolean).
- CCI_OBOS_Period (Default: 14) - Lookback period for the short-term CCI threshold filter (in bars).
- CCI_OBOS_Applied (Default: PRICE_CLOSE) - Applied price source for the short-term CCI calculation.
- CCI_Overbought (Default: 100.0) - Upper CCI threshold level for bullish momentum confirmation (oscillator index units).
- CCI_Oversold (Default: -100.0) - Lower CCI threshold level for bearish momentum confirmation (oscillator index units).
Filter Module 12: RVI Trend and Signal Filters
- Use_RVI_Filter (Default: false) - Enables or disables Relative Vigor Index zero-line vigor confirmation (true/false boolean).
- RVI_Period (Default: 75) - Lookback period for the RVI zero-line bias filter (in bars).
- Use_RVI_Signal_Filter (Default: false) - Enables or disables RVI main-versus-signal line crossover alignment (true/false boolean).
- RVI_Signal_Period (Default: 20) - Lookback period for the RVI main/signal alignment filter (in bars).
Filter Module 13: MACD Histogram and Zero-Line Filters
- Use_MACD_Filter (Default: false) - Enables or disables MACD histogram polarity confirmation (true/false boolean).
- MACD_FastEMA (Default: 12) - Fast EMA period for MACD calculation (in bars).
- MACD_SlowEMA (Default: 26) - Slow EMA period for MACD calculation (in bars).
- MACD_SignalSMA (Default: 9) - Signal line SMA smoothing period for MACD calculation (in bars).
- MACD_Applied (Default: PRICE_CLOSE) - Applied price source for MACD calculation.
- Use_MACD_Zero_Filter (Default: false) - Enforces MACD main line positioning above zero for BUY and below zero for SELL (true/false boolean).
Filter Module 14: Support/Resistance and Fibonacci Retracement Filters
- Use_SR_Filter (Default: false) - Enables or disables dynamic swing Support and Resistance zone proximity validation (true/false boolean).
- SR_Period (Default: 50) - Lookback window used to identify recent swing highs and lows (in bars).
- SR_Zone_Points (Default: 80) - Proximity tolerance band around detected Support and Resistance levels (in broker points).
- Use_Fib_Filter (Default: false) - Enables or disables swing-based Fibonacci retracement zone validation (true/false boolean).
- Fib_Level_1 (Default: 0.382) - First Fibonacci retracement zone boundary ratio (decimal ratio).
- Fib_Level_2 (Default: 0.618) - Second Fibonacci retracement zone boundary ratio (decimal ratio).
- ZigZag_Depth (Default: 12) - Minimum bar depth required to identify structural swing highs and lows (in bars).
- ZigZag_Deviation (Default: 5) - Minimum price excursion required between consecutive swing extremes (in broker points).
- ZigZag_Backstep (Default: 3) - Minimum bar spacing between adjacent swing points (in bars).
Filter Module 15: Supertrend Filter
- Use_Supertrend_Filter (Default: false) - Enables or disables ATR-based Supertrend directional regime filtering (true/false boolean).
- ST_AtrPeriod (Default: 10) - ATR volatility lookback period used by the Supertrend module (in bars).
- ST_Factor (Default: 3.0) - Volatility band multiplier applied to ATR in the Supertrend calculation (multiplier).
7. 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 or historical signal behavior does not guarantee future results. This indicator is strictly a technical analysis and charting visualization tool; it does not execute automated trades or provide financial investment advice. Always test and evaluate all settings thoroughly on a Demo Account before applying the tool to live market analysis.
