KF Market Structure

KF Market Structure — Smart Money Concepts Trend & Breakout Analyzer

KF Market Structure is a clean, rule-based Smart Money Concepts (SMC) indicator for MetaTrader 5 that automatically detects and visualizes market structure: Swing Highs, Swing Lows, Break of Structure (BOS), and Change of Character (CHoCH). Built strictly for closed bar evaluation, it provides an objective structural baseline for Price Action traders and automated trading strategies without erratic signals.

Whether you trade Forex, Gold, or Crypto, understanding whether the current move is a trend continuation (BOS) or a structural trend reversal (CHoCH) is essential. KF Market Structure gives you crisp chart lines, clear text annotations, and dedicated data buffers ready for Expert Advisor (EA) integration via iCustom.

KEY FEATURES
- Closed Bar Evaluation: Evaluates strictly closed bars (shift 1 and older). The live forming candle (shift 0) never produces permanent structural signals.
- Strict Closing-Price Break: Penumbra/wicks crossing swing levels without a closing price break are treated as liquidity sweeps/wicks, not structural breaks.
- Objective Trend Engine: Tracks market state transitions between Bullish (+1.0), Bearish (-1.0), and None (0.0).
- Trend Continuation (BOS): Marks breakouts in the direction of the prevailing trend as Break of Structure (BOS).
- Structural Reversal (CHoCH): Marks the first breakout against the prevailing trend as Change of Character (CHoCH).
- Visual Chart Overlays: Displays break lines and text tags ("BOS" / "CHoCH") with customizable colors and dash styles.
- Automatic Chart Cleanup: Chart objects are automatically limited (default 200) and completely removed upon deinitialization.
- Multi-Channel Notifications: Pop-up alerts, sound notifications, and mobile push notifications for closed-bar breaks with baseline anti-spam guards.
- Lightweight & Backtest Safe: Core calculations are separated from visual rendering; visual objects are skipped during non-visual backtesting to maintain fast execution.

INDICATOR BUFFERS FOR EXPERT ADVISORS (iCustom)
Automate your trading by reading dedicated buffers via iCustom:
- Buffer 0 (Plot 0): Swing High price level (High price of confirmed swing bar; EMPTY_VALUE otherwise)
- Buffer 1 (Plot 1): Swing Low price level (Low price of confirmed swing bar; EMPTY_VALUE otherwise)
- Buffer 2 (Calculations): Structure Signal Code on the breakout bar:
  * +1.0 = Bullish BOS (Trend continuation)
  * -1.0 = Bearish BOS (Trend continuation)
  * +2.0 = Bullish CHoCH (Trend reversal from Bearish to Bullish)
  * -2.0 = Bearish CHoCH (Trend reversal from Bullish to Bearish)
  * +3.0 = Initial Bullish Break (First trend initialization from neutral state)
  * -3.0 = Initial Bearish Break (First trend initialization from neutral state)
  *  0.0 = No breakout
- Buffer 3 (Calculations): Active Market Trend:
  * +1.0 = Bullish
  * -1.0 = Bearish
  *  0.0 = None / Undetermined

TECHNICAL NOTE ON SWING CONFIRMATION
A swing point at bar k requires N subsequent bars to close before it is objectively confirmed. Consequently, confirmed swing arrows appear N bars after the actual peak/trough formed. Once plotted, swing levels are immutable. Breakout signals (Buffer 2) appear immediately on the closed breakout candle (bar 1).

INPUT PARAMETERS
- Swing Confirmation Length (N Bars): Number of bars required on each side to confirm a swing pivot (default: 3).
- Max History Bars to Scan: Historical depth scanned for structure analysis (default: 500).
- Show Swing Points (High/Low): Toggle arrows on confirmed swing points.
- Draw Break Structure Lines: Toggle horizontal lines from broken swings to the breakout bar.
- Show Structure Labels (BOS/CHoCH): Toggle text annotations on breakout candles.
- Maximum Chart Objects Limit: Upper cap for active chart objects to ensure smooth rendering (default: 200).
- Bullish Structure Color: Color for bullish lines and tags (default: DodgerBlue).
- Bearish Structure Color: Color for bearish lines and tags (default: Crimson).
- Structure Line Style: Line style for break levels (default: DASH).
- Structure Line Width: Line thickness (default: 1).
- Alert Dialog Popup: Terminal pop-up alert on new closed bar break.
- Push Notifications to Mobile: MetaTrader 5 mobile push notifications.
- Play Sound Alert: Audio chime alert.
- Sound File Name: Audio file name (default: "alert.wav").

RECOMMENDED ECOSYSTEM PRODUCTS
Looking for advanced Smart Money Concepts features like Fair Value Gaps (FVG) and Order Blocks? Explore our upcoming institutional suite on MQL5 Market:
- KF Candle Scanner — Rule-based candlestick pattern scanner (available now on MQL5 Market).
- KF Spread Swap Monitor — Real-time spread and swap tracking utility (available now on MQL5 Market).

REQUIREMENTS
- MetaTrader 5 Terminal (Build 4000 or higher).
- Works on all standard timeframes (M1 to MN1).
- Compatible with all major Forex pairs, Gold (XAUUSD), Indices, and Crypto.
- No DLLs or external dependencies required.

RISK WARNING
Trading foreign exchange, commodities, and financial instruments involves substantial risk and is not suitable for all investors. Market structure mapping and swing levels are interpretative technical indicators based on historical price data. Past performance and backtest results do not guarantee future performance.

More from author
Algo Samurai Gold
Abdul Malikul Hanan
Algo Samurai Gold: Scalp XAUUSD with Built-in Profit Protection Real Account Signal Page :    https://www.mql5.com/en/signals/2235827 https://www.mql5.com/en/signals/2239627 https://www.mql5.com/en/signals/2240852 set file used :   AlgoSamuraiGold Trade Gold with Confidence and Control Algo Samurai Gold is an automated forex trading robot (Expert Advisor) designed to scalp profits from the XAUUSD (Gold) market. This scalping strategy allows you to capitalize on small price movements throughout
AG Session Box
Abdul Malikul Hanan
AG Session Box — Asian, London & New York Trading Sessions with Auto GMT Detection AG Session Box is a high-performance, non-repainting session visualization indicator designed for intraday traders, ICT/SMC practitioners, and breakout specialists on MetaTrader 5. It automatically plots the three major trading sessions—Asian, London, and New York—directly on your chart using clean, customizable background boxes.  Equipped with an intelligent broker-to-GMT offset detection engine, AG Session Bo
FREE
Spread & Swap Monitor — Real-Time Trading Cost & Rollover Fee Tracker for MT5 Never enter a trade blind to broker spreads and overnight financing fees. Spread & Swap Monitor provides an elegant, non-intrusive on-chart HUD that continuously tracks live spread volatility against a rolling average and calculates real swap costs directly converted into your account currency. KEY FEATURES - Real-Time Spread Tracking: Displays live spread in both pips and raw points. - Dynamic Volatility Alert: Spr
FREE
KF Risk Calculator
Abdul Malikul Hanan
KF Risk Calculator — Interactive On-Chart Position Sizing & Risk Management Panel KF Risk Calculator is a professional on-chart utility indicator for MetaTrader 5 designed to eliminate position sizing errors. It calculates your optimal lot size in real time based on your account balance, equity, or fixed cash risk, ensuring your volume strictly adheres to your broker's volume constraints (min lot, max lot, and step size). Featuring interactive draggable Stop Loss and Take Profit lines, it prov
FREE
Algo Samurai
Abdul Malikul Hanan
3 (2)
Live Account Signal : https://www.mql5.com/en/signals/2229036 Set File Used : algosamurai_SR_V2 Algo Samurai Expert Advisor Algo Samurai is a complete automated forex trading strategy designed for all skill levels. It's more than just software; it's a fully automatic trading robot that uses self-adaptive market algorithms to analyze price movements and identify trading opportunities. It also features a built-in Smart Profit Lock System to secure your gains while the trade remains open, all wit
Revoltix
Abdul Malikul Hanan
Revoltix EA PRO - Dynamic Straddle Scalping System Precision in Panic. Profit in Revolt. Revoltix EA PRO is a sophisticated straddle scalping system designed to capture volatility breakouts with institutional-grade risk management. This Expert Advisor employs dynamic order adjustment and multi-layered safety protocols to navigate volatile market conditions systematically. Revoltix Live Signal:   CLICK HERE Core Strategy & Technology: Dynamic Straddle System : Automatically places and adjusts BU
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 comp
FREE
Filter:
No reviews
Reply to review