PinBar Candle Detector Price Action Filter Signals
- インディケータ
- バージョン: 2.90
- アップデート済み: 27 10月 2026
- アクティベーション: 5
Multi-Pattern Signal Suite with Universal 14-Filter Framework for MetaTrader 5
1. Product Overview
Multi-Pattern Signal Suite is an advanced technical analysis indicator engineered for the MetaTrader 5 terminal. The indicator detects high-probability candlestick formations comprising PinBar, Candle Rejection, and Marubozu (Full Body Candle) patterns. To eliminate market noise and false breakout formations, the core price action engine is integrated with the Universal MultiFilterSuite framework: a modular matrix of 14 technical filters spanning trend, momentum, volatility, volume, and structural price levels. The software operates strictly on confirmed candle closes to ensure non-repainting execution, providing visual chart arrows, terminal notifications, and audio alerts.
2. Non-Repainting Execution Architecture
The software enforces an uncompromising non-repainting calculation model. Signals and visual objects are calculated strictly on completed historical bars (index shift 1 or bar index rates_total - 2). During the formation of the active candle (bar 0 / rates_total - 1), internal buffers remain uncommitted and visual signal buffers are explicitly assigned EMPTY_VALUE. A signal arrow and alert trigger only upon the complete close of the candidate candle when all mathematical conditions and active filter criteria are met. Once plotted on a closed candle, signal arrows do not recalculate, shift position, or disappear on historical data.
3. Mathematical Formulations of Candlestick Patterns
The indicator evaluates four geometric parameters for each bar: Body = |Close - Open|, Total Range = High - Low, Upper Wick = High - Max(Open, Close), and Lower Wick = Min(Open, Close) - Low.
* PinBar Pattern:
- Bullish PinBar: Candle must close bullish (Close > Open). Lower wick must exceed upper wick by the factor PinBarRatio (LowerWick >= PinBarRatio * UpperWick) and must exceed the candle body by BodyRatio (LowerWick >= BodyRatio * Body).
- Bearish PinBar: Candle must close bearish (Close < Open). Upper wick must exceed lower wick by the factor PinBarRatio (UpperWick >= PinBarRatio * LowerWick) and must exceed the candle body by BodyRatio (UpperWick >= BodyRatio * Body).
* Candle Rejection Pattern:
- Bullish Rejection: Rejection wick (Lower Wick) must satisfy LowerWick >= Body * WickToBodyRatio. The opposing wick (Upper Wick) cannot exceed UpperWick <= Body * MaxOppositeWick. The candle body must not exceed the defined portion of the total range (Body / Range <= MaxBodyPercent). When RequireBullishBody is true, Close > Open is strictly enforced.
- Bearish Rejection: Rejection wick (Upper Wick) must satisfy UpperWick >= Body * WickToBodyRatio. The opposing wick (Lower Wick) cannot exceed LowerWick <= Body * MaxOppositeWick. The candle body must satisfy Body / Range <= MaxBodyPercent. When RequireBearishBody is true, Close < Open is strictly enforced.
* Marubozu (Full Body Candle) Pattern:
- Bullish Marubozu: Candle must close higher than open (Close > Open). The candle body must span nearly the entire range, adhering to the floating-point precision tolerance |Body - Range| <= Point * 0.1, indicating negligible wicks.
- Bearish Marubozu: Candle must close lower than open (Close < Open). The candle body must adhere to |Body - Range| <= Point * 0.1.
* Entry Method Modes (InpEntryMethod):
- ENTRY_REJECTION_MARUBOZU (0): Evaluates Candle Rejection and Marubozu formations simultaneously.
- ENTRY_REJECTION_ONLY (1): Scans exclusively for Candle Rejection formations.
- ENTRY_MARUBOZU_ONLY (2): Scans exclusively for Marubozu formations.
- ENTRY_PINBAR_ONLY (3): Scans exclusively for PinBar formations.
- ENTRY_ALL (4): Evaluates PinBar, Rejection, and Marubozu patterns simultaneously.
4. Universal MultiFilterSuite Analytical Logic
Signals generated by the candlestick engine are evaluated against 14 modular technical filters. Any active filter that fails its logical test immediately invalidates the signal.
* Filter 1: RSI Cross Filter (Relative Strength Index)
- Purpose: Momentum threshold reversal filter.
- BUY Logic: RSI line crosses upward above RSI_Oversold (RSI[shift] > RSI_Oversold and RSI[shift+1] <= RSI_Oversold).
- SELL Logic: RSI line crosses downward below RSI_Overbought (RSI[shift] < RSI_Overbought and RSI[shift+1] >= RSI_Overbought).
* Filter 2: ADX Filter (Average Directional Index)
- Purpose: Volatility and trend strength baseline.
- Logic: Validates BUY or SELL only when ADX main line >= ADX_Min_Level. Ensures signals are generated only during defined trending conditions.
* Filter 3: Single MA Filter (Moving Average Baseline)
- Purpose: Macro directional baseline filter.
- BUY Logic: Close price must be strictly greater than Moving Average buffer (Close > MA[shift]).
- SELL Logic: Close price must be strictly lower than Moving Average buffer (Close < MA[shift]).
* Filter 4: Ichimoku Senkou Span B Filter
- Purpose: Equilibrium cloud boundary filter.
- BUY Logic: Close price must be strictly above Senkou Span B (Close > SenkouSpanB[shift]).
- SELL Logic: Close price must be strictly below Senkou Span B (Close < SenkouSpanB[shift]).
* Filter 5: RSI 75 Filter
- Purpose: Long-period macroeconomic momentum filter.
- BUY Logic: Long-period RSI (default period 75) must be above median baseline (RSI75[shift] > 50.0).
- SELL Logic: Long-period RSI must be below median baseline (RSI75[shift] < 50.0).
* Filter 6: Double MA Filter (Dual Moving Average Alignment)
- Purpose: Moving average crossover/alignment filter.
- BUY Logic: Fast Moving Average must be greater than Slow Moving Average (MA_A[shift] > MA_B[shift]).
- SELL Logic: Fast Moving Average must be lower than Slow Moving Average (MA_A[shift] < MA_B[shift]).
* Filter 7: Awesome Oscillator (AO) Triple Sub-Filter
- Purpose: Market momentum and volume verification.
- Volume Check: AO_Buy_Min and AO_Sell_Max require AO values to exceed specified positive/negative thresholds.
- Color Check: AO value must increase for BUY (AO[shift] > AO[shift+1]) and decrease for SELL (AO[shift] < AO[shift+1]).
- Zero Line Check: AO must be positive and rising for BUY (AO > AO[shift+1] and AO > 0.0); negative and falling for SELL (AO < AO[shift+1] and AO < 0.0).
* Filter 8: Parabolic SAR Filter (Stop and Reverse)
- Purpose: Directional trailing momentum support.
- BUY Logic: Close price must be strictly greater than Parabolic SAR value (Close > SAR[shift]).
- SELL Logic: Close price must be strictly lower than Parabolic SAR value (Close < SAR[shift]).
* Filter 9: Heiken Ashi Filter
- Purpose: Synthetic bar trend smoothing filter.
- BUY Logic: Synthesized Heiken Ashi candle must close bullish (HA_Close[shift] > HA_Open[shift]).
- SELL Logic: Synthesized Heiken Ashi candle must close bearish (HA_Close[shift] < HA_Open[shift]).
* Filter 10: CCI Trend Filter (Commodity Channel Index Baseline)
- Purpose: Cyclical deviation trend filter.
- BUY Logic: CCI line must be greater than zero equilibrium line (CCI[shift] > 0.0).
- SELL Logic: CCI line must be lower than zero equilibrium line (CCI[shift] < 0.0).
* Filter 11: CCI OB/OS Filter (Extreme Momentum Breakout)
- Purpose: High-velocity momentum extension filter.
- BUY Logic: CCI line must trade above the overbought threshold (CCI[shift] > CCI_Overbought).
- SELL Logic: CCI line must trade below the oversold threshold (CCI[shift] < CCI_Oversold).
* Filter 12: RVI Trend & Signal Filter (Relative Vigor Index)
- Purpose: Directional energy and signal crossover filter.
- RVI Trend Logic: RVI main line must be positive for BUY (RVI[shift] > 0.0) and negative for SELL (RVI[shift] < 0.0).
- RVI Signal Logic: RVI main line must exceed RVI signal line for BUY (RVI_Main[shift] > RVI_Sig[shift]) and trade below for SELL (RVI_Main[shift] < RVI_Sig[shift]).
* Filter 13: MACD Histogram & Zero Level Filter
- Purpose: Moving average convergence divergence momentum filter.
- MACD Histogram Logic: MACD histogram (Main - Signal) must be positive for BUY (Hist[shift] > 0.0) and negative for SELL (Hist[shift] < 0.0).
- MACD Zero Logic: MACD main buffer must trade above zero for BUY (MACD_Main[shift] > 0.0) and below zero for SELL (MACD_Main[shift] < 0.0).
* Filter 14: Support/Resistance & Fibonacci Retracement Structural Filters
- Dynamic S&R Logic: Scans SR_Period bars for the lowest low and highest high. A BUY signal requires candle low to touch or penetrate the support zone bounded by SR_Zone_Points * Point. A SELL signal requires candle high to touch or penetrate the resistance zone.
- Fibonacci Retracement Logic: Employs a custom series ZigZag swing scanner (Depth, Deviation, Backstep) to identify structural swing highs and lows. It computes golden ratio retracement bands between Fib_Level_1 and Fib_Level_2. The active candle range must intersect the calculated retracement corridor.
5. Visual Plotting and Notification Framework
* Graphical Chart Plots:
- Plot 0: Buy Signal Arrow (Index 0, clrAqua, default Wingdings character 233). Placed below the low of the signal candle.
- Plot 1: Sell Signal Arrow (Index 1, clrRed, default Wingdings character 234). Placed above the high of the signal candle.
- Arrow Spacing: Vertical distance calculated via ArrowDistance * Point to prevent arrow overlap with candle wicks.
* Multi-Channel Notification Dispatcher:
- Pop-up Dialog Alert: Generates a native MetaTrader terminal dialog displaying pattern identification, symbol, and timeframe.
- Acoustic Audio Alert: Triggers local playback of a configured WAV audio file upon candle confirmation.
- Mobile Push Notification: Dispatches real-time signal alerts directly to iOS and Android MetaTrader terminals via MetaQuotes ID.
- Email Transmission: Sends structured alert headers and candle details via the terminal SMTP protocol.
6. Complete Input Parameters Reference
=== 1. ENTRY METHOD SELECTION ===
- InpEntryMethod (Default: ENTRY_REJECTION_MARUBOZU) -> Selects active pattern detection logic: Rejection + Marubozu, Rejection Only, Marubozu Only, PinBar Only, or All Patterns Combined (ENUM_ENTRY_METHOD).
=== 2. CANDLE REJECTION SETTINGS ===
- WickToBodyRatio (Default: 2.5) -> Minimum ratio of the rejection wick relative to the candle body size (Double).
- MaxOppositeWick (Default: 0.4) -> Maximum permissible ratio of the opposing non-rejection wick relative to body size (Double).
- MaxBodyPercent (Default: 0.30) -> Maximum fraction of total candle range that the body can occupy, expressed as 0.0 to 1.0 (Double).
- RequireBullishBody (Default: false) -> Restricts Bullish Rejection signals exclusively to candles where Close > Open (Boolean).
- RequireBearishBody (Default: false) -> Restricts Bearish Rejection signals exclusively to candles where Close < Open (Boolean).
=== 3. PINBAR DETECTION SETTINGS ===
- PinBarRatio (Default: 2.0) -> Minimum ratio between the primary tail wick and the secondary nose wick (Double).
- BodyRatio (Default: 1.0) -> Minimum ratio between the primary tail wick and the candle body (Double).
=== 4. VISUAL & ARROW SETTINGS ===
- ArrowCodeBuy (Default: 233) -> Wingdings character code used to render upward BUY signal arrows on chart (Integer).
- ArrowCodeSell (Default: 234) -> Wingdings character code used to render downward SELL signal arrows on chart (Integer).
- ArrowDistance (Default: 80) -> Vertical distance in Points from the candle High or Low for arrow placement (Integer).
=== 5. ALERTS & NOTIFICATIONS ===
- EnablePopupAlert (Default: true) -> Enables native MetaTrader pop-up dialog box when a signal triggers on bar close (Boolean).
- EnableSound (Default: true) -> Activates acoustic alert playback upon signal confirmation (Boolean).
- SoundFile (Default: "alert2.wav") -> Specifies the audio filename located in the terminal Sounds directory (String).
- EnablePushNotification (Default: true) -> Transmits push notifications to mobile MetaTrader terminals via MetaQuotes ID (Boolean).
- EnableEmailAlert (Default: false) -> Transmits signal alerts via SMTP mail server configured in terminal options (Boolean).
=== 6. RSI CROSS FILTER ===
- Use_RSI_Cross_Filter (Default: false) -> Toggles RSI oversold/overbought boundary crossover verification (Boolean).
- RSI_Length (Default: 14) -> Period for RSI calculation (Integer, Bars).
- RSI_Price_Source (Default: PRICE_CLOSE) -> Applied price constant used for RSI computation (ENUM_APPLIED_PRICE).
- RSI_Oversold (Default: 30.0) -> Oversold boundary level for upward cross confirmation (Double).
- RSI_Overbought (Default: 70.0) -> Overbought boundary level for downward cross confirmation (Double).
=== 7. ADX FILTER ===
- Use_ADX_Filter (Default: false) -> Toggles ADX minimum trend strength filter (Boolean).
- ADX_Period (Default: 10) -> Smoothing period for ADX calculation (Integer, Bars).
- ADX_Min_Level (Default: 20.0) -> Minimum ADX main threshold required to validate any signal (Double).
=== 8. SINGLE MA FILTER ===
- Use_MA_Filter (Default: false) -> Toggles single Moving Average price location filter (Boolean).
- MA_Period (Default: 50) -> Averaging period for Moving Average calculation (Integer, Bars).
- MA_Method (Default: MODE_SMA) -> Smoothing method: SMA, EMA, SMMA, or LWMA (ENUM_MA_METHOD).
- MA_Shift (Default: 0) -> Horizontal bar offset applied to Moving Average line (Integer, Bars).
=== 9. ICHIMOKU SENKOU SPAN B FILTER ===
- Use_Ichimoku_Filter (Default: false) -> Toggles Ichimoku Senkou Span B baseline filter (Boolean).
- Ichimoku_Tenkan (Default: 9) -> Period of Tenkan-sen conversion line (Integer, Bars).
- Ichimoku_Kijun (Default: 26) -> Period of Kijun-sen base line (Integer, Bars).
- Ichimoku_SenkouB (Default: 52) -> Period of Senkou Span B leading line (Integer, Bars).
=== 10. RSI 75 FILTER ===
- Use_RSI75_Filter (Default: false) -> Toggles long-period RSI baseline filter (Boolean).
- RSI_Filter_Period (Default: 75) -> Period for long-cycle RSI calculation (Integer, Bars).
=== 11. DOUBLE MA FILTER ===
- Use_DoubleMA_Filter (Default: false) -> Toggles dual Moving Average alignment filter (Boolean).
- MA_A_Period (Default: 30) -> Period of fast Moving Average A (Integer, Bars).
- MA_A_Method (Default: MODE_EMA) -> Smoothing method for Moving Average A (ENUM_MA_METHOD).
- MA_A_Applied (Default: PRICE_CLOSE) -> Applied price for Moving Average A (ENUM_APPLIED_PRICE).
- MA_A_Shift (Default: 0) -> Horizontal bar shift for Moving Average A (Integer, Bars).
- MA_B_Period (Default: 140) -> Period of slow Moving Average B (Integer, Bars).
- MA_B_Method (Default: MODE_EMA) -> Smoothing method for Moving Average B (ENUM_MA_METHOD).
- MA_B_Applied (Default: PRICE_CLOSE) -> Applied price for Moving Average B (ENUM_APPLIED_PRICE).
- MA_B_Shift (Default: 0) -> Horizontal bar shift for Moving Average B (Integer, Bars).
=== 12. AWESOME OSCILLATOR FILTER ===
- Use_AO_Filter (Default: false) -> Master toggle for Awesome Oscillator analytical suite (Boolean).
- Use_AO_Volume_Filter (Default: false) -> Enables absolute amplitude thresholds for AO (Boolean).
- AO_Buy_Min (Default: 4.0) -> Minimum positive AO amplitude threshold required for BUY signals (Double).
- AO_Sell_Max (Default: -4.0) -> Maximum negative AO amplitude threshold required for SELL signals (Double).
- Use_AO_Color_Filter (Default: false) -> Requires green bar slope (AO > previous) for BUY, red bar slope for SELL (Boolean).
- Use_AO_Zero_Filter (Default: false) -> Requires AO to be positive and rising for BUY, negative and falling for SELL (Boolean).
=== 13. PARABOLIC SAR FILTER ===
- Use_SAR_Filter (Default: false) -> Toggles Parabolic SAR trailing trend confirmation (Boolean).
- SAR_Step (Default: 0.02) -> Acceleration factor increment step for SAR calculation (Double).
- SAR_Maximum (Default: 0.2) -> Maximum acceleration factor cap for SAR calculation (Double).
=== 14. HEIKEN ASHI FILTER ===
- Use_HeikenAshi_Filter (Default: false) -> Toggles synthetic Heiken Ashi bar directional color filter (Boolean).
=== 15. CCI TREND FILTER ===
- Use_CCI_Filter (Default: false) -> Toggles CCI zero-line directional trend confirmation (Boolean).
- CCI_Period (Default: 50) -> Averaging period for CCI calculation (Integer, Bars).
- CCI_Applied (Default: PRICE_CLOSE) -> Applied price for CCI calculation (ENUM_APPLIED_PRICE).
=== 16. CCI OB & OS FILTER ===
- Use_CCI_OBOS_Filter (Default: false) -> Toggles CCI extreme breakout momentum filter (Boolean).
- CCI_OBOS_Period (Default: 14) -> Period for OB/OS CCI calculation (Integer, Bars).
- CCI_OBOS_Applied (Default: PRICE_CLOSE) -> Applied price source for OB/OS CCI (ENUM_APPLIED_PRICE).
- CCI_Overbought (Default: 100.0) -> Overbought boundary threshold for BUY signals (Double).
- CCI_Oversold (Default: -100.0) -> Oversold boundary threshold for SELL signals (Double).
=== 17. RVI FILTERS ===
- Use_RVI_Filter (Default: false) -> Toggles RVI zero-line baseline directional filter (Boolean).
- RVI_Period (Default: 75) -> Calculation period for baseline RVI (Integer, Bars).
- Use_RVI_Signal_Filter (Default: false) -> Toggles RVI main vs signal line crossover verification (Boolean).
- RVI_Signal_Period (Default: 20) -> Calculation period for RVI signal crossover line (Integer, Bars).
=== 18. MACD FILTERS ===
- Use_MACD_Filter (Default: false) -> Toggles MACD histogram directional momentum filter (Boolean).
- MACD_FastEMA (Default: 12) -> Fast Exponential Moving Average period (Integer, Bars).
- MACD_SlowEMA (Default: 26) -> Slow Exponential Moving Average period (Integer, Bars).
- MACD_SignalSMA (Default: 9) -> Signal line Simple Moving Average period (Integer, Bars).
- MACD_Applied (Default: PRICE_CLOSE) -> Applied price source for MACD computation (ENUM_APPLIED_PRICE).
- Use_MACD_Zero_Filter (Default: false) -> Toggles MACD main line zero-axis position filter (Boolean).
=== 19. SR & FIBONACCI FILTERS ===
- Use_SR_Filter (Default: false) -> Toggles dynamic Support and Resistance breakout/retest filter (Boolean).
- SR_Period (Default: 50) -> Number of historical bars evaluated to identify swing high and swing low zones (Integer, Bars).
- SR_Zone_Points (Default: 80) -> Tolerance band around Support/Resistance levels measured in Points (Double).
- Use_Fib_Filter (Default: false) -> Toggles ZigZag-driven Fibonacci retracement zone filter (Boolean).
- Fib_Level_1 (Default: 0.382) -> Lower retracement golden ratio boundary level (Double).
- Fib_Level_2 (Default: 0.618) -> Upper retracement golden ratio boundary level (Double).
- ZigZag_Depth (Default: 12) -> Minimum bar interval for ZigZag swing point detection (Integer, Bars).
- ZigZag_Deviation (Default: 5) -> Price deviation threshold in points required for ZigZag reversal (Integer, Points).
- ZigZag_Backstep (Default: 3) -> Minimum number of bars between consecutive swing pivots (Integer, Bars).
7. Operational Setup & Recommendations
* Supported Instruments: Highly liquid Forex pairs (EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD), Indices (US30, NAS100, GER40), and Commodities (XAUUSD, US Oil).
* Recommended Timeframes:
- Scalping & Intraday: M5, M15, and M30.
- Swing Trading: H1, H4, and D1.
* Filter Selection Practice: It is not recommended to activate all 14 filters simultaneously. A robust setup typically combines 1 price action pattern mode with 1 trend filter (e.g., Single MA or Double MA) and 1 momentum/structural filter (e.g., RSI Cross or Support/Resistance). Activating too many filters simultaneously will result in over-filtering and extremely rare signal generation.
* Installation: Place the indicator file (.mq5) and the header file MultiFilterSuite.mqh inside your terminal's MQL5/Indicators directory. Ensure MultiFilterSuite.mqh is placed in the MQL5/Include directory or adjacent to the indicator source. Compile in MetaEditor.
8. Risk Disclaimer
Trading foreign exchange, indices, equities, commodities, and digital assets carries substantial risk of capital loss and is not suitable for all investors. Technical indicators are mathematical tools designed to assist in charting and pattern identification; they do not guarantee future profitability, eliminate market risk, or predict price action with certainty. Past performance observed in backtesting or historical charting does not guarantee future results. Users must thoroughly test this indicator on a demo account under realistic market conditions and spread environments before deploying it in live trading.
