KF Candlestick Scanner
- インディケータ
- バージョン: 1.0
KF Candlestick Scanner — Rule-Based Price Action Confirmation (Pinbar, Engulfing, Doji)
KF Candlestick Scanner is a clean, lightweight on-chart price action confirmation indicator for MetaTrader 5 that detects three core candlestick pattern families: Pinbar (Hammer / Shooting Star), Engulfing, and Doji formations.
Designed for rule-based price action traders and algorithmic developers, the indicator evaluates closed bars only. Sinyal and chart arrows appear on Bar 1 immediately after it completes and Bar 0 opens. Live Bar 0 is never evaluated, ensuring that arrows and data values remain permanent once printed. Furthermore, the indicator features a dedicated 3-buffer architecture that provides instant, structured access for Expert Advisors via iCustom.
KEY FEATURES
- Core Pattern Detection: Pinbar / Hammer (Bullish/Bearish), Engulfing (Bullish/Bearish), and Doji (Dragonfly, Gravestone, Standard).
- Evaluates Closed Bars Only: All calculations occur on confirmed, closed candles (shift >= 1). The active candle (Bar 0) is never signaled, preventing phantom cues.
- Dedicated 3-Buffer Architecture (EA-Ready):
* Buffer 0 (Plot 0): Bullish Arrow Price (exact Low of candle, Wingdings 233).
* Buffer 1 (Plot 1): Bearish Arrow Price (exact High of candle, Wingdings 234).
* Buffer 2 (Hidden Data): Pattern identification code (ENUM_AG_CANDLE_PATTERN integer) for automated algorithmic decision-making.
- Pure ATR Volatility Filter: Automatically screens out insignificant candles during illiquid sessions based on an ATR multiple.
- Independent Group & Direction Switches: Toggle individual pattern groups (Pinbar, Engulfing, Doji) and signal directions (Bullish, Bearish).
- Standard Doji Integration Rule: Standard Doji (indecision) is recorded exclusively in hidden Buffer 2 for EA integration when Doji patterns are enabled (InpEnableDoji = true), and never generates chart arrows, audio/push alerts, or text labels. Dragonfly and Gravestone Dojis provide directional bullish-leaning and bearish-leaning signals.
- Collision-Free Text Labels: Optional on-chart pattern names positioned with dynamic ATR distance offsets and upper/lower anchors to avoid obscuring arrow characters.
- Anti-Spam Notification Engine: Multi-channel alerts (Terminal Pop-up, Sound, Mobile Push, and Email) equipped with initial chart baseline time suppression and single-signal-per-bar deduplication.
- Lightweight & Tester-Safe: UI objects and sound alerts automatically disengage during non-visual Strategy Tester runs, while buffer calculations continue at full speed.
HOW TO USE
1. Attach KF Candlestick Scanner to your preferred chart and timeframe.
2. Select your desired pattern groups and signal directions in the Input settings.
3. Configure the ATR multiple filter (default 0.5x) to ignore low-volatility consolidation noise.
4. When a confirmed pattern closes, a colored arrow appears at the candle's extreme price, accompanied by your configured notification.
EXPERT ADVISOR INTEGRATION (iCustom)
Developers can seamlessly integrate KF Candlestick Scanner into their automated systems:
- Buffer 0: iCustom(_Symbol, _Period, "KF_CandleScanner", ..., 0, shift) -> Returns Low price if Bullish signal, or EMPTY_VALUE.
- Buffer 1: iCustom(_Symbol, _Period, "KF_CandleScanner", ..., 1, shift) -> Returns High price if Bearish signal, or EMPTY_VALUE.
- Buffer 2: iCustom(_Symbol, _Period, "KF_CandleScanner", ..., 2, shift) -> Returns integer pattern code:
* 1 = Bullish Pinbar / Hammer
* 2 = Bearish Pinbar / Shooting Star
* 3 = Bullish Engulfing
* 4 = Bearish Engulfing
* 5 = Standard Doji (Neutral)
* 6 = Dragonfly Doji (Bullish-leaning)
* 7 = Gravestone Doji (Bearish-leaning)
* 0 = No pattern detected
INPUT PARAMETERS
- Enable Pinbar / Hammer: Toggle Bullish & Bearish Pinbar patterns.
- Enable Engulfing: Toggle Bullish & Bearish Engulfing patterns.
- Enable Doji: Toggle Doji patterns (Dragonfly, Gravestone, Standard).
- Enable Bullish Signals: Filter for upward-directed signals (Buffer 0).
- Enable Bearish Signals: Filter for downward-directed signals (Buffer 1).
- Min Candle Range (ATR Multiple): Minimum bar range in ATR units (0.0 = disabled).
- ATR Period: Calculation period for the built-in pure ATR engine.
- Max History Bars to Scan: Limits historical bar calculations for maximum chart responsiveness.
- Bullish / Bearish Arrow Code: Customize Wingdings arrow symbols (defaults: 233 and 234).
- Arrow Vertical Shift (Pixels): Visual distance adjustment using native PLOT_ARROW_SHIFT.
- Show Pattern Text Labels: Enable or disable text labels on the chart.
- Max Labels on Recent Bars: Quota limit for on-chart text labels.
- Text Label Font Size: Font sizing for chart text objects.
- Terminal Pop-up Alert: Native modal dialog on new signals.
- Play Sound Alert: Audio playback with custom WAV support.
- Mobile Push Notification: Sends notifications to your MT5 mobile app.
- Email Notification: Sends signal alerts via SMTP email.
- Show Recommended Products: Prints official recommended tools from kampusforex.id to the Experts log.
RECOMMENDED PRODUCTS
Looking for more essential trading utilities? Check out our published tools on our MQL5 Market profile:
- AG Session Box: Clean visual trading sessions with automatic GMT offset detection.
- KF Risk Calculator: Interactive position sizing and risk management panel.
- KF Spread Swap Monitor: Real-time spread and overnight swap tracking utility.
REQUIREMENTS & LIMITATIONS
- Evaluates closed bars only: Sinyal appears immediately at the open of the subsequent bar.
- Push and email notifications require proper configuration under MT5 Tools -> Options.
- This product is an analytical chart indicator; it does not place or manage orders automatically.
DISCLAIMER
Candlestick patterns are price action confirmation tools, not standalone trading signals. They should not be traded in isolation without proper market structure context, support/resistance verification, and sound risk management.
RISK WARNING
Trading Forex, Commodities, Indices, and Cryptocurrencies involves substantial risk of loss and is not suitable for every investor. Never risk more capital than you can afford to lose.
