ICT Dealing Range [Malibu]ICT Dealing Range Engine is an open-source market structure and imbalance indicator built to organize multiple ICT-style concepts inside a single live dealing range framework. Instead of plotting Fair Value Gaps, Order Blocks, Breaker Blocks, and equilibrium zones as disconnected elements, this script uses the active dealing range as a structural engine that helps filter, organize, and maintain the most relevant zones around current price.
The purpose of this indicator is not to flood the chart with every possible imbalance or block. Its purpose is to build a cleaner, more contextual map of price by combining dealing range logic, equilibrium, liquidity interaction, market structure shifts, Fair Value Gaps, Inverted Fair Value Gaps, Order Blocks, and Breaker Blocks into one coordinated framework. This makes the script especially useful for traders who want to study price delivery inside a living range rather than treat each concept as an isolated label.
At the center of the script is a rolling dealing range calculated from a user-defined lookback window. The highest high and lowest low within that window define the active range boundaries, while the midpoint defines the equilibrium level. These values are not drawn as static references. They continuously update with market movement, which allows the range to function as a live structural context rather than a fixed historical box. The range can be visually extended to the right and styled with its own fill and boundary colors so that it remains readable without overwhelming the chart.
This range engine is what gives the script its identity. Many indicators can detect FVGs, Order Blocks, or swing-based zones, but they often do so everywhere on the chart without a hierarchy of relevance. In this script, the dealing range can act as a filter, meaning zones can be accepted, preserved, or removed according to whether they belong to the active structural window. That design choice helps reduce clutter and keeps the chart focused on what is currently most relevant from a structural perspective. Instead of treating the range as decoration, the script turns it into the framework that governs how other zones are interpreted.
The indicator can display the active dealing range itself, including the range high, range low, and optional equilibrium line. On top of that structural layer, it can detect bullish and bearish Fair Value Gaps, convert broken gaps into Inverted Fair Value Gaps, identify bullish and bearish Order Blocks after liquidity and structure conditions are met, and build bullish and bearish Breaker Blocks from recent swing relationships. Each of these zone categories can be managed independently, which gives the user control over both logic and presentation.
The Fair Value Gap engine uses a classic three-candle imbalance relationship. A bullish FVG forms when the older candle’s high is below the current candle’s low, creating a void that suggests upward displacement. A bearish FVG forms when the older candle’s low is above the current candle’s high, creating a downward imbalance. This script does not stop at merely finding such gaps. It can also require the gap to be meaningful relative to ATR, which helps ignore very thin or insignificant imbalances that often clutter lower timeframes. Once a qualifying gap is found, it is projected forward as a live zone so the user can monitor future interaction with it.
The Inverted Fair Value Gap logic extends that idea further. If a bullish FVG later breaks to the downside by close, the script can convert it into a bearish IFVG. If a bearish FVG later breaks to the upside by close, it can become a bullish IFVG. This is important because failed imbalances often retain analytical value after polarity changes. Instead of treating a broken gap as useless, the script can reinterpret it as a new directional zone. This creates a more complete picture of how imbalance evolves as price transitions from one state to another.
The Order Block logic is intentionally more selective than simple “last opposite candle” approaches. The script first tracks confirmed pivot highs and pivot lows using the chosen pivot length. Those pivots are then monitored for liquidity sweeps. A move above a stored pivot high marks buy-side liquidity taken, while a move below a stored pivot low marks sell-side liquidity taken. These events alone do not create an Order Block. Instead, they establish the context needed for the next confirmation step.
After liquidity is taken, the script waits for a close-based Market Structure Shift. This means price must actually close through a relevant structural level in the opposite direction before an Order Block candidate is allowed to form. Once that sequence completes, the script scans backward over a configurable number of bars to find the first qualifying opposite candle and uses that candle’s range as the Order Block. In practical terms, after sell-side liquidity is swept and bullish structure shifts, the script searches for a bearish candle to define a bullish OB. After buy-side liquidity is swept and bearish structure shifts, it searches for a bullish candle to define a bearish OB. This makes the Order Block engine more conditional, more context-aware, and less arbitrary than approaches that mark every local opposite candle before a move.
The Breaker Block logic is also structure-driven rather than purely cosmetic. For bearish breakers, the script looks for a high-low-high relationship in which the more recent high exceeds the previous one and price later closes below the intervening low. For bullish breakers, it looks for a low-high-low relationship in which the more recent low undercuts the previous one and price later closes above the intervening high. When those conditions are met, the corresponding region is marked as a Breaker Block. This approach makes breaker creation dependent on actual structural sequencing rather than on a simple visual approximation. To keep the chart readable, the script can also suppress near-duplicate breakers using ATR-based distance checks and remove breaker zones once they exceed a user-defined maximum age.
A major strength of the script is that all of these zones can optionally be filtered through the active dealing range. If enabled, only FVGs, IFVGs, OBs, and BBs that belong to the current structural window are retained. This is one of the main reasons the indicator is useful as a full framework rather than as a loose collection of concepts. The range is not merely a backdrop. It acts as a relevance filter that helps keep attention on the most structurally important zones around current price.
The script also includes a maintenance layer for zone management. Once zones are created, they can be extended forward for continued monitoring. If price invalidates or mitigates a zone, that zone can either be deleted or faded depending on the user’s preference. This is especially useful for traders who want to preserve historical context without keeping fully active boxes on the chart. Breakers can also expire based on age, and every major category has a cap on how many active regions can remain on screen. These controls are important not only for visual clarity but also for overall chart performance and usability.
From a user interface standpoint, the indicator is organized into functional groups so the settings remain easy to understand. The Dealing Range section controls the rolling range window, midpoint visibility, forward extension, and styling for the box and lines. The FVG / IFVG section manages gap detection, range filtering, extension length, and directional colors. The Order Blocks section controls pivot sensitivity, activation, range filtering, extension, scan depth, and color settings. The Breaker Blocks section manages activation, range filtering, extension, age limits, and directional styling. Finally, the Style / Performance section controls label visibility, label color, mitigation fading, faded opacity, and the maximum number of retained zones per category.
This layout is intentional. The script is meant to remain usable for both visual traders and more process-oriented users who want to adjust sensitivity and chart density. A lower pivot length will make the structure engine more reactive, while a higher pivot length will usually produce cleaner but slower structural responses. A shorter range lookback will make the dealing range more adaptive, while a larger one will emphasize broader price boundaries. FVG filtering, zone retention, and fading options can all be adjusted depending on how minimal or information-dense the chart should be.
A practical workflow is to first identify the active dealing range and its equilibrium. That establishes the structural frame. From there, the user can observe which imbalances and reaction zones are forming inside that range, whether price is operating above or below equilibrium, and whether recent liquidity events are producing valid structure shifts. Bullish or bearish FVGs can then be evaluated in the context of current price location, while Order Blocks and Breaker Blocks can be interpreted as more conditionally derived zones that reflect structural responses rather than raw candle patterns. If price later invalidates an FVG and flips it into an IFVG, that polarity change remains visible and can be studied as part of the evolving delivery process.
Key features:
• Rolling dealing range with optional equilibrium line
• Optional dealing-range filter for FVG, IFVG, OB, and BB zones
• ATR-based Fair Value Gap thickness filter
• Sweep + close-based Market Structure Shift logic for Order Blocks
• Structure-based Breaker Block detection
• Inverted Fair Value Gap polarity flips after invalidation
• Zone extension, cleanup, fading, and age controls
• Per-category retention limits for better chart clarity
• Organized input groups for range, FVG/IFVG, OB, BB, and style/performance settings
How to use:
Use the dealing range to define the current structural window, then use equilibrium as the internal reference point of that range. Monitor which FVGs, OBs, and BBs form inside that context, and pay attention to whether price respects, mitigates, invalidates, or flips those zones. The script is most useful when its zones are read as contextual structural areas rather than as automatic signals.
Notes:
This indicator is a chart analysis tool, not a promise of outcome. It does not guarantee direction, entries, or performance. Past market behavior does not guarantee future results. Like any structure- or imbalance-based model, it should be used together with confirmation, risk management, and broader market context.
This script is published as open-source so users can inspect the logic, study the implementation, and adapt the framework for their own research and education.
อินดิเคเตอร์ Pine Script®






















