SMC OrderBlocks AIO MT4
- Indicadores
- Versão: 3.12
- Atualizado: 14 abril 2026
- Ativações: 10
Order Blocks All-in-One — SMC Indicator for MT4
For MT5 version: https://www.mql5.com/en/market/product/166409
A comprehensive Order Block technical analysis indicator designed to track the execution lifecycle of structural zones from initial formation to mitigation and potential conversion into breakout levels within a single implementation.
Built upon the framework of Market Structure and Smart Money Concepts (SMC), this tool maps key price action levels directly onto the MetaTrader 4 terminal chart.
Order Blocks operate as technical support and resistance levels mapped from specific swing highs and swing lows where significant price displacement initiates. Traders monitor these zones for potential price reactions, either as structural bounces or as breakout retests if the zone is completely penetrated.
This tool automates the process of identifying these structural levels based on objective algorithmic calculations, eliminating manual charting variance.
Unified State Tracking Architecture
Instead of rendering separate plots for different structural stages, this indicator integrates zone tracking into a single continuous framework that updates dynamically across three distinct operational states:
- Unmitigated: A newly formed structural zone that the price action has not yet retraced into. These represent primary areas of historical price imbalance. Displayed as a solid color rectangle.
- Mitigated: Occurs when the price retraces and enters the boundary of the zone (via candle wick penetration) without closing beyond it. This indicates partial mitigation of the area. Displayed as a dimmed rectangle.
- Breaker: Triggered when a candle closes fully past the opposing boundary of the zone. The zone is classified as a broken level or breaker block, serving as a potential role-reversal level. Displayed as a fixed boundary rectangle.
Technical Note: Unmitigated zones indicate fresh price imbalances. Mitigated zones show active historical tests, while breaker blocks represent verified structural breakdowns where broken support may act as technical resistance and vice versa.
Core Features and Technical Specifications
- Algorithmic Detection: Utilizes automated ZigZag swing point calculations combined with a multi-step validation filter to identify key structural points and filter out minor price fluctuations.
- Real-Time State Transitions: Monitors zone interactions on a tick-by-tick basis, instantly updating the rendering styles, labels, and system alerts upon price contact.
- Visual Themes: Includes predefined presets (Default, Dark, Light) and unlocks individual custom color definitions for all bullish and bearish zone states.
- Three Validation Modes: Offers Strict (body comparison, impulse expansion, and displacement gap confirmation), Moderate (body comparison and impulse expansion), or Relaxed (impulse expansion only) calculation settings.
- Swing-Based Expiration: Automatically archives historical zones after a user-defined number of subsequent ZigZag swings to maintain a clean workspace.
- Automated Data Labeling: Displays text markers indicating the specific type and state directly within the rendered graphical shapes.
- Candle Highlighting: Visually isolates the precise source candle responsible for creating the structural block for easy structural reference.
- Market Structure Visualization: Provides optional rendering of the underlying ZigZag baseline vectors and peak/valley coordinate markers.
- Terminal Alerts: Supports native audio alerts and pop-up notifications for zone formations, mitigations, and structural breaches.
- Memory Management Modules: Features automated periodic cleanups of expired data arrays to ensure smooth chart rendering performance over extensive histories.
Technical Detection Logic
The indicator implements a multi-stage filtering process to determine valid structural candles. The extreme high and low coordinates of the validated candle define the respective vertical boundaries of the zone.
Stage 1: Swing Coordinate Mapping
The core algorithm maps swing highs and swing lows using mathematical pivot scanning. The candle situated at the absolute apex of the pivot point is isolated as a baseline candidate.
Stage 2: Momentum Comparison
The immediate succeeding bar must exhibit a larger relative real body dimension compared to the baseline candidate candle, verifying clear price momentum away from the structural pivot.
Stage 3: Displacement Confirmation
The shadow of the third subsequent bar must not overlap with the shadow of the baseline candidate candle. This confirms the presence of an imbalance or Fair Value Gap (FVG), indicating a clear directional displacement.
Configuration Detail: Enabling the direction filter restricts the logic so that bullish zones only generate on bearish baseline candles, and bearish zones only generate on bullish baseline candles, aligning strictly with standard market structure tenets.
Zone State Lifecycle Rules
- Unmitigated to Mitigated: Triggered when price wick enters the boundary coordinates while the bar close remains within or outside the structure.
- Unmitigated to Breaker: Triggered when a bar establishes a confirmed close entirely past the opposing zone boundary.
- Mitigated to Breaker: Triggered when price closes beyond the coordinates of a previously tested zone.
Once a zone transitions into a Breaker state, its horizontal extension terminates, locking the boundary at the exact bar where the structural invalidation occurred.
Parameter Reference Guide
Order Block Calculations
- OB Validation Mode: Selects the filtering criteria (Strict, Moderate, Relaxed) to adjust the baseline sensitivity.
- Filter OB Candle Direction: Toggles the directional candle constraint for structural zones.
- OB Expiry (ZZ swings): Defines the maximum threshold of structural swings a zone remains active before automatic archiving. Set to 0 for continuous tracking.
- Show Unmitigated / Mitigated / Breaker: Individual visibility toggles for each distinct structural state.
- Extend Zone by N Candles: Sets the forward rendering length. Setting to 0 extends the rectangles continuously to the current time vector.
- Zone Label Font Size / Show Zone Labels: Visual text toggles and font sizes for interior zone identification labels.
ZigZag Parameters
- Depth / Deviation / Backstep: Core mathematical settings for swing point isolation. Default values are configured at 12, 5, and 3.
- Mark Peaks and Valleys / Marker Size: Renders geometric shapes and defines marker size at validated swing highs and lows.
- Show ZigZag Line / Line Width / Line Style: Toggles and configures the display of trend line connections between mapped pivot points.
Color Configurations
- Color Preset: Chooses between Default, Dark, Light, or Custom color mapping templates.
- Custom Colors: Individual custom color controls for Bearish/Bullish OB Candle Highlight, Bearish/Bullish Unmitigated Zone, Bearish/Bullish Mitigated Zone, Bearish/Bullish Breaker Zone, Text Color, and ZigZag Color when the Custom preset is enabled.
System Alerts
- Enable Popup Alert / Enable Sound Alert: Directs notifications to the native terminal window. Alerts are programmatically suspended during initial history loading phases to mitigate initialization noise.
- Alert Sound File: Input field for local audio file paths.
- Max Order Blocks to Track: Sets the absolute maximum limit of active structural array objects to regulate memory allocation. Default is 300.
Performance Metrics and Code Optimization
- Bar-Close Scan Logic: Core detection calculations run exclusively upon the opening of a new bar rather than on every incoming tick, significantly reducing CPU overhead.
- Asynchronous State Evaluation: Tick-level updates are restricted strictly to tracking active price mitigation coordinates.
- Memory Management: Built-in cleanup routines systematically deallocate expired graphic elements to maintain peak system responsiveness.
- Unique Object Identification: Employs distinct timestamped naming variables to guarantee zero structural object rendering conflicts.
- Alert Control Throttling: Implements hard limits to allow a maximum of one notification per event per bar, eliminating notification flooding during sudden market velocity.
Target Application
- Market Structure Practitioners: Provides automated technical frameworks for tracking swing developments and supply/demand areas.
- Algorithmic Analysts: Translates subjective price action concepts into strictly defined mathematical levels.
- Intraday and Swing Traders: Provides adjustable sensitivity parameters to adapt structural layouts across short-term scalping or long-term position holdings.
System Compatibility
- Compatible with all standard currency pairs, commodities, indices, and cryptocurrency assets.
- Functional across all standard MetaTrader 4 timeframes from M1 to MN.
- Operates completely standalone without requiring external DLL modifications.
Important Operational Notice: This indicator serves exclusively as a technical analysis charting utility designed to assist manual market evaluations. It does not generate standalone trading signals or financial advice. All technical analysis must be paired with comprehensive risk management parameters and an established trading plan. Past historical chart presentations provide no absolute guarantee of future market performance.
Technical Support: For configuration inquiries, optimization parameters, or technical questions, please utilize the product Comments section or initiate a direct platform inquiry.
