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. Indicator

Order Block Detector [SMC ChartSense]# SMC ChartSense — Order Block Detector
**Order block detection with mandatory FVG (Fair Value Gap) confirmation.** Each zone marked must have a 3-bar FVG at the anchor candle — institutional displacement that left a literal gap in price. Most basic OB scripts flag every breakout candle as an order block; this script filters to only the zones that came with displacement footprint, producing a cleaner chart with fewer but more meaningful zones.
## How it works
The script tracks swing pivots at a configurable length and waits for a confirmed break — a candle that closes beyond the prior swing high or low. When a break occurs, it searches back through the recent bars to identify the deepest counter-direction candle (lowest low for a bullish OB, highest high for a bearish OB). This becomes the OB anchor.
The anchor is then validated against the FVG requirement: there must be a 3-bar gap at the anchor index (bar A high below bar C low for bullish, bar A low above bar C high for bearish). No FVG, no OB. This is the central quality filter.
Validated zones extend forward from the anchor and remain active until invalidated — either when price closes through the zone or when the wick touches the far side, depending on user preference.
## Features
- FVG validation gate at the anchor candle (3-bar gap requirement)
- Configurable swing pivot length for structural sensitivity
- User-tunable OB anchor lookback (5–100 bars)
- Wick-based or body-based zone definition
- Configurable mitigation trigger: Close-through or Wick-touch
- Auto-pruning of oldest OBs when active count exceeds limit
- Optional faded display of mitigated zones for historical study
- Built on Pine v6 with clean, maintainable architecture
## Inputs
**Structure Detection**
- *Swing Pivot Length* — Higher values produce fewer, more significant pivots. Lower values produce more frequent pivots of smaller structural significance. Default: 5.
**Quality Filters**
- *OB Anchor Lookback Bars* — How far back from a confirmed pivot break to search for the OB anchor candle. Default 30 covers most timeframes; reduce for scalping, increase for higher TFs.
- *Anchor OB to Wick (vs Body)* — Wick mode uses the full candle range. Body mode uses open/close only (tighter zones).
- *Mitigation Trigger* — Close mode invalidates when a candle closes through the zone. Wick mode invalidates on first wick touch.
**Visualization**
- Bull/Bear OB colors (customizable)
- Max OBs Per Side (caps active display, oldest auto-pruned)
- Show OB Labels (off by default — boxes alone are usually sufficient)
- Show Midline (50% level inside each OB, dotted)
- Keep Mitigated OBs Visible (faded gray boxes remain for historical reference)
## Built-in alerts
- New Bull OB formed
- New Bear OB formed
- Bull OB touched (price entered zone)
- Bear OB touched (price entered zone)
## Suggested use
Best on liquid intraday markets — major forex pairs, crypto perps, index futures, large-cap equities — at timeframes from 5m to 4h. Default settings are tuned for 15m–1h ranges; adjust Swing Pivot Length down to 3 for scalping or up to 8–10 for higher-TF trend trading.
Use this as a context tool. The zones identify where institutional displacement occurred — actual entries should incorporate your own analysis: HTF bias, structural alignment with current market regime, risk-reward planning, and confirmation from other tools.
## Part of the SMC ChartSense suite
One of several focused SMC tools. Designed to work alongside other SMC ChartSense scripts for a coherent analytical workflow across the SMC vocabulary.
## Disclaimer
This is a technical analysis tool. It does not provide investment advice or trade recommendations. The author is not a SEBI-registered Research Analyst. Use at your own risk; do your own due diligence. Indicator

Black Tie SMCA complete Smart Money Concepts toolset on a single chart. Plots the
building blocks structure-based traders work with: market structure breaks
on two levels, order blocks, equal highs and lows, fair value gaps,
strong and weak extremes, and premium/discount zones.
WHAT IT INCLUDES
Swing Structure
Tracks the larger market shifts. Plots BOS (Break of Structure) when
price continues in the prevailing direction and CHoCH (Change of
Character) when the structural bias flips.
Internal Structure
Tracks short-term shifts within the larger swing structure. Same BOS and
CHoCH logic on a smaller pivot length. Optional confluence filter
requires the breaking candle to have more body than wick on the
breakout side, filtering weak breaks.
Order Blocks
The last opposing candle before a structural break. Plotted as a zone
that price often retests. Available on both swing and internal levels,
with separate counts and color settings for each. Volatility filtered
(ATR or Cumulative Mean Range) to avoid blocks formed on engulfing
candles. Mitigation tracked by close or wick.
Equal Highs and Equal Lows
Pivots that form at similar prices, marking liquidity pools. The
tolerance is expressed in ATR multiples, so the detection scales with
each instrument.
Fair Value Gaps
Three-bar imbalances where price moved without being balanced. Often
acts as future support or resistance. Auto-threshold filters small
gaps based on average bar size. Multi-timeframe support.
Strong and Weak Highs and Lows
The most recent significant high and low, labeled as Strong (the
opposite extreme was swept) or Weak (it held while the opposite was
swept). Useful for identifying which side of the range carries
liquidity.
Premium and Discount Zones
Divides the most recent swing range into Premium (top), Equilibrium
(middle), and Discount (bottom). For timing entries within a
structural range.
HOW TO USE
Use Swing Structure for directional context, Internal Structure for
timing. Order Blocks and Fair Value Gaps mark zones where price often
reacts. Equal Highs and Equal Lows mark where liquidity sits. Premium
and Discount zones tell you whether you are buying or selling at a
favorable location within the range.
This is a visualization toolset, not a signal generator. The chart still
requires interpretation.
SETTINGS
Display Mode controls whether all historical structures stay on chart
(Historical) or only the most recent ones are kept (Present, default).
Every component can be enabled or disabled individually so you only see
what you need on the chart. Indicator

Smart Money Concept: Liquidity Sweep [MarkitTick]💡 The Smart Money Concept: Liquidity Sweep is an advanced technical suite engineered for precision algorithmic trading and comprehensive market analysis.
this unified market intelligence hub tracks major market participant footprints by analyzing liquidity raids, structural shifts, and fair value gaps.
It operates strictly on confirmed data to ensure zero lookahead bias, making it an authoritative tool for quantitative analysts and disciplined traders who demand rigorous data integrity.
This system provides a complete and deterministic view of price action, abstracting complex market mechanics into clear, actionable signals.
Every module within this script has been optimized for minimal execution overhead while maximizing analytical depth.
● ✨ Originality and Utility
Unlike generic structure indicators that simply plot highs and lows, this tool integrates a proprietary Confluence Score Dashboard and a robust Liquidity Sweep Filter.
It does not merely react to price crossing a level; it evaluates the nature of the interaction, distinguishing between genuine market structure shifts and manipulative liquidity sweeps orchestrated by large-cap market participants.
By unifying ten distinct analytical modules into a single, performance-optimized architecture, it provides a complete and cohesive trading ecosystem without cluttering the chart.
These modules range from Order Block mitigation tracking to Session Kill Zones and Premium/Discount mapping, ensuring all aspects of price action are covered.
Furthermore, it is explicitly built for automation, seamlessly generating strictly formatted JSON payloads for direct routing to external execution platforms like PineConnector or 3Commas.
These JSON webhooks dynamically calculate and transmit precise Entry, Take Profit, and Stop Loss parameters strictly utilizing format.mintick string conversions.
● 🔬 Methodology and Concepts
The core engine operates on a multi-dimensional analysis framework, utilizing advanced market mechanics to decode price delivery algorithms:
• Fractal Market Structure
The script mathematically identifies key swing points to establish dynamic structural ranges.
It accurately tracks the active trend and flags both Break of Structure (BOS) and Change of Character (CHoCH) events based on confirmed price closes.
This ensures that the underlying trend logic is grounded in true market conviction rather than momentary volatility.
• Liquidity Engineering
The engine actively monitors previous pivot extremes for sweep conditions.
This ensures that entries are backed by strategic liquidity harvesting from large-volume entities, rather than falling for premature breakouts or retail traps.
• Multi-Timeframe Alignment
The indicator employs a higher-timeframe variance filter to gauge the overarching trend direction.
It utilizes offset data arrays with strict lookahead protection to ensure a strictly non-repainting bias confirmation across multiple chart periods.
• Inefficiency Mapping
The algorithm detects and maintains active Fair Value Gaps (FVG) and structural Inducements (IDM).
It dynamically mitigates and clears these zones from the chart as price action naturally rebalances the market inefficiency, keeping the visual workspace clean.
● 🎨 Visual Guide
The script provides a clean, highly actionable visual hierarchy directly on the chart to minimize cognitive load:
Structure Candles:
Candlesticks are dynamically colored to reflect the current internal state.
They are painted Cyan during confirmed bullish structural trends and Magenta during confirmed bearish trends.
Structural Lines and Labels:
Dashed lines project horizontally from broken swing points.
These lines are explicitly annotated with BOS or CHoCH labels indicating the exact direction and type of structural shift that occurred.
Zone Fills (Boxes):
Support and Resistance Zones: Cyan and Magenta boxes highlight active bullish and bearish Order Blocks (OB). Mitigated blocks dynamically change to a muted gray color to reduce visual noise.
Premium and Discount Zones: When enabled, the active structural range is divided into a Magenta Premium zone, a white Equilibrium line, and a Cyan Discount zone.
FVG Zones: Transparent graphical fills indicate unmitigated Fair Value Gaps waiting for price rebalancing.
Session Kill Zones: Highlighted backgrounds map the Asian (Orange), London (Gold), and New York (Green) active trading windows for temporal confluence.
Inducement Labels:
Yellow IDM tags mark minor pullbacks that have been successfully swept, confirming liquidity capture.
Confluence Dashboard:
A dynamic text label appears precisely at the point of signal generation.
It displays an aggregate score from 0 to 5, color-coded Green for High Confluence, Orange for Medium, or Red for Low.
A detailed hover-tooltip breaks down the active filters contributing to the score.
● 📖 How to Use
To maximize the utility of this robust tool, traders should seek alignment across multiple internal analytical modules:
Establish Context:
Begin by utilizing the Session Kill Zones and Premium/Discount areas to frame the current market environment.
Ideal long setups originate deep within the Cyan Discount zone during active London or New York trading hours.
Identify Liquidity Capture:
Wait patiently for a confirmed liquidity sweep or the breaking of an Inducement (IDM) level.
This validates that major market operators have accumulated positions and trapped counter-trend traders.
Confirm the Shift:
Monitor the chart for a valid BOS or CHoCH signal backed by the Confluence Score Dashboard.
A score of 4 or 5 indicates exceptionally high alignment between HTF bias, liquidity sweeps, market gaps, and session timing.
Execution and Risk:
Upon signal generation, the script automatically plots the optimal entry point.
It also calculates a dynamic ATR-based Stop Loss and a predefined Risk/Reward-based Take Profit.
These exact price coordinates are simultaneously broadcast via the automated JSON alert webhook for seamless execution.
● ⚙️ Inputs and Settings
The suite is highly customizable, divided into logical control groups for rapid configuration:
• Market Structure
Adjust the Swing Length sensitivity to filter out market noise and define the exact target Risk/Reward Ratio for automated signal generation.
• Visuals
Granular control is provided over all interface colors, including specific toggles for dynamic candle coloring and user-configurable zone opacities.
• Toggleable Filter Modules
Ten individual toggles allow users to enable or disable specific algorithmic engines, including:
① Liquidity Sweep Filter
② HTF Bias Filter (with customizable resolution)
③ Premium / Discount Zone
④ Session Kill Zones
⑤ Fair Value Gap Engine
⑥ Inducement Detection
⑦ MSS Body Confirmation (requires full body closes for valid structure breaks)
⑧ ATR-Adaptive SL (with custom length and standard deviation multiplier)
⑨ OB Mitigation Tracker
⑩ Confluence Score Dashboard
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The algorithmic foundation of this analytical suite is firmly anchored in Auction Market Theory and variance-adjusted statistical modeling.
At its core, the indicator rejects the standard premise of random walk price action, instead modeling the financial market as a highly efficient, liquidity-seeking mechanism.
By mathematically isolating structural extremes and standardizing pivot lengths, the engine calculates the probability of order flow absorption versus trend continuation.
The script analyzes the temporal decay of market inefficiencies, specifically mapping how quickly Fair Value Gaps are rebalanced by subsequent price delivery.
The inclusion of an ATR-adaptive risk model ensures that stop-loss parameters expand and contract proportionally to current market variance.
This utilizes average true range standard deviations to normalize volatility, preventing premature stop-outs during periods of high structural stress.
Furthermore, the proprietary Confluence Score relies on a multi-variate Boolean matrix.
This matrix synthesizes time-domain variables (Session Zones), spatial distribution metrics (Premium/Discount mapping), and momentum vectors (HTF Bias) into a singular, quantized metric of setup validity.
This deterministic mathematical approach removes subjective bias, relying purely on the physics of price delivery, volume distribution, and order flow imbalance.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicator

Aperture Imbalance Register [JOAT]Aperture Imbalance Register
Introduction
Aperture Imbalance Register is an open-source Pine Script v6 indicator built to detect, rank, and manage directional imbalance zones in a more structured way than a basic fair value gap overlay. Instead of marking every raw three-candle gap and leaving the trader to judge which ones matter, the script builds a register of active bullish and bearish imbalance zones, measures their internal lower-timeframe participation, assigns a quality score, tracks mitigation progress, and keeps the resulting stack visible with a compact institutional-style dashboard.
The problem this indicator solves is selectivity. Many imbalance tools show too many zones, retire them too slowly, or provide no context for which inefficiencies are likely to matter. Aperture Imbalance Register focuses on the active imbalance stack and grades each register by combining gap displacement with lower-timeframe volume participation. That lets the trader see not only where imbalance exists, but how concentrated the internal participation was when the zone formed.
The script is designed for traders who use imbalance as part of a broader market-structure process. It is not trying to predict every reversal. It is designed to answer practical chart questions: where are the open directional inefficiencies, how strong are they, how much of each zone has been mitigated, and whether the current stack favors bullish or bearish continuation pressure.
Because the script uses Pine Script v6 lower-timeframe arrays, the register is not just a visual box painter. It uses lower-timeframe intrabar data to build participation histograms inside each zone, identify the local point of control of the imbalance, and display whether a register still has open space or has already been substantially repaired by later price action.
Core Concepts
1. Confirmed Bullish and Bearish Gap Detection
The script detects a bullish register when the current low is above the high from two bars ago and the middle bar confirms continuation. It detects a bearish register with the inverse condition. A sigma-style filter based on the statistical size of the gap helps reject weaker dislocations:
bool confirmedBullGap = enoughGapHistory and barstate.isconfirmed and low > high and high > high and bullGapSigma > gapSigma
bool confirmedBearGap = enoughGapHistory and barstate.isconfirmed and high < low and low < low and bearGapSigma > gapSigma
This means the indicator is not plotting every minor price skip. It requires both structural displacement and a size filter before a new register is added to the active stack.
2. Lower-Timeframe Participation Ranking
Once a gap is confirmed, the script requests lower-timeframe `close` and `volume` data using `request.security_lower_tf()` and maps intrabar participation into configurable bins across the zone. That participation profile is then used to score the register.
This matters because not all imbalances are equal. Some form with broad participation spread across the full zone. Others form with concentrated acceptance in one portion of the gap. The participation histogram helps identify where the market transacted most heavily inside the register and where the imbalance may be most meaningful on a retest.
3. Quality Scoring and Register Prioritization
Each register receives a quality score derived from the concentration of lower-timeframe participation plus the size of the gap sigma event. Higher-quality zones get more visual emphasis, stronger edges, and greater dashboard influence.
In practice, this creates a hierarchy. The trader does not need to treat every imbalance equally. The register list naturally emphasizes the zones with stronger displacement and denser participation.
4. Mitigation Tracking and Lifecycle Management
Open imbalance is not enough. What matters is whether the zone remains unfilled. The script measures mitigation depth as price trades back into the register and updates the display from open to partial mitigation to fully filled. When the `Retire Fully Mitigated Zones` option is enabled, fully repaired or invalidated zones are removed from the active stack.
This keeps the chart cleaner and prevents stale boxes from dominating the view after the market has already rebalanced the inefficiency.
5. Participation Histogram and Local POC
Each register can display a small internal histogram showing participation intensity by price segment. The maximum participation bin defines the register’s local point of control, and that level is drawn as a line through the zone.
This gives the register more structure than a plain box. Instead of just seeing the outer bounds, the trader can see where activity concentrated inside the imbalance.
Features
Bullish and bearish imbalance registers: Detects confirmed gap-style inefficiencies in both directions using confirmed-bar logic
Lower-timeframe participation model: Uses lower-timeframe arrays to rank each register by internal participation rather than gap presence alone
Quality scoring: Combines participation concentration and sigma displacement into a single register score
Mitigation tracking: Continuously estimates how much of each register has been repaired by later price action
Automatic lifecycle retirement: Fully mitigated or invalidated zones can be retired automatically to reduce clutter
Internal histogram bars: Optional profile bars show where lower-timeframe participation concentrated inside the zone
Point-of-control line: Each register maintains a local participation midpoint for tactical reference
Midline support: Optional dotted midpoint line helps visualize the fair center of the register
Dashboard summary: Displays bull count, bear count, mitigated count, average quality, best quality, stack count, and bias
Data-window exports: Publishes stack bias, quality sum, and active register count for downstream reading
Visual Elements
Register boxes: The outer body of each imbalance zone shows whether price is dealing with bullish or bearish open inefficiency
Participation bars: Optional internal profile bars highlight where lower-timeframe participation concentrated inside the register
Midline and POC references: The centerline and participation high point help identify the most important sub-levels inside the zone
Adaptive edge intensity: Stronger registers receive more visual emphasis than weaker ones
Mitigation labels: Each register updates from open to mitigation to filled so the chart communicates lifecycle state directly
Best Practices
Use the register stack as context, then let your own execution model decide entries
Favor high-quality registers that align with broader structure instead of reacting to every new zone
Treat partial mitigation as a sign that some imbalance has already been repaired, not as automatic invalidation
Be especially careful on symbols with poor lower-timeframe data because internal participation quality can degrade
If the active stack flips from one side to the other quickly, read that as changing imbalance context rather than a guaranteed reversal signal
Input Parameters
Intrabar Data:
Auto Lower Timeframe: Automatically derives a lower timeframe for participation analysis
Custom Lower Timeframe: Allows manual lower-timeframe selection when auto mode is disabled
Calculation Depth: Controls how much lower-timeframe history is requested
Imbalance Detection:
Gap Sigma Filter: Sets the minimum displacement strength required for a new register
Participation Bins: Controls how many internal profile slices are built inside each zone
Max Active Registers: Limits how many open registers remain on the chart at once
Retire Fully Mitigated Zones: Removes zones once they are effectively repaired or invalidated
Lifecycle And Display:
Extend Active Zones: Extends open registers to the right for forward reference
Show Participation Histogram: Displays the internal lower-timeframe bar profile
Show Midline: Draws a dotted centerline through each register
Show Dashboard: Enables the top-right summary panel
How to Use This Indicator
Step 1: Read the Stack Bias
Start with the dashboard. Compare the bullish and bearish active register counts and note the stack bias value. A positive bias means bullish imbalance is dominating the active structure. A negative bias means bearish imbalance is dominating.
Step 2: Focus on Quality, Not Quantity
Use the average and strongest quality readings to judge whether the active stack is meaningful. A chart with fewer but stronger registers is often more actionable than a chart with many weak inefficiencies.
Step 3: Watch Mitigation Progress
Each active register updates from open to partial mitigation to filled. Open registers represent unresolved inefficiency. Deeply mitigated registers have already lost part of their tactical edge.
Step 4: Use The Internal Profile
When the participation histogram is enabled, look for bins that concentrated most of the intrabar volume. The local point of control and denser profile segments often become the most useful retest references inside the wider zone.
Step 5: Apply It As Context, Not A Standalone Trigger
Aperture Imbalance Register works best as a context layer. It helps frame whether an imbalance stack is supporting continuation or warning of unresolved opposing pressure. Use it with your own structure, execution, and risk model.
Indicator Limitations
Because the script uses lower-timeframe data requests, realtime behavior can differ slightly from historical behavior as new intrabars accumulate inside the live bar
Mitigation does not guarantee reversal or continuation. It only shows how much of the zone has been traded back through
A strong register can still fail if broader market structure, liquidity, or volatility conditions change
On very low-history charts or symbols with thin lower-timeframe data, participation quality can be less informative than on liquid instruments
Originality Statement
Aperture Imbalance Register is original in the way it treats imbalances as managed registers rather than passive boxes. The script is published because it contributes more than a generic fair value gap mashup:
It ranks each imbalance with a lower-timeframe participation model instead of drawing every gap with equal importance
It combines gap displacement, intrabar participation, mitigation tracking, and internal histogram rendering into a single workflow
It maintains a tactical register stack with lifecycle management rather than leaving stale zones permanently on the chart
It exposes stack-level information through a dashboard and data-window fields so the indicator can be read systematically
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Imbalance zones are analytical references based on historical price behavior and lower-timeframe participation, not guarantees of future reaction. Markets can rebalance, ignore, or invalidate any zone without warning. Always use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Indicator

Indicator

PDArraysLibrary "PDArrays"
Hi all!
This library will help you to draw fair value gaps and order blocks and their broken version; breaker blocks, mitigation blocks and inversion fair value gaps.
It does not contain any example code, but I will create an indicator called 'PD Arrays' that uses this library.
Best of luck trading!
Remove(zones, settings)
Removes the zone in 'zones.Remove' and its visuals. The visuals will be kept if 'settings.KeepHistoryZones' is true.
Parameters:
zones (Zones) : The current zone.
settings (Settings) : Set all values in this parameter to define the settings for the zones.
Interactions(zones, settings, trend)
Sets the interactions (retests\false breakouts\breakouts) from the library 'Touched'.
Parameters:
zones (array)
settings (Settings) : set all values in this parameter to define the settings for the order block creation.
trend (int) : the market structure trend that's used for the integrations direction. 1 = bullish, -1 = bearish, 0 = both.
HiddenInteractions(zones, settings, marketStructureInfo, trend)
Sets the hidden interactions (only breakouts) from the library 'Touched'.
Parameters:
zones (Zones)
settings (Settings) : set all values in this parameter to define the settings for the order block creation.
marketStructureInfo (MarketStructureInfo) : The state of market structure needed.
trend (int) : the market structure trend that's used for the integrations direction. 1 = bullish, -1 = bearish, 0 = both.
Pivots(settings)
Creates pivots (high and low) to be used for order block creation.
Parameters:
settings (Settings) : set all values in this parameter to define the settings for the order block creation.
Returns: a tuple containing two pivot values (high and low) or 'na'
OrderBlock(settings, pivotHigh, pivotLow)
Creates an order block if one is found according to the settings parameter.
Parameters:
settings (Settings) : set all values in this parameter to define the settings for the order block creation.
pivotHigh (float) : The high pivot to use.
pivotLow (float) : The low pivot to use.
Returns: a Zone object if an order block is found, na otherwise
FairValueGap(settings)
Creates a fair value gap if one is found according to the settings parameter.
Parameters:
settings (Settings) : set all values in this parameter to define the settings for the fair value gap creation.
Returns: a Zone object if a fair value gap is found, na otherwise
SetBarIndex(zone)
Sets the 'BarIndex' value of the 'zone' object according to 'zone.ChartBaseTime'.
Parameters:
zone (Zone) : The 'Zone' object to set the bar index on.
MarketStructureZones(marketStructureInfo, foundZones, zones, priceAction, settings)
Creates/draws zones (order blocks and fair value gaps) depending on the current market structure from the price action.
Parameters:
marketStructureInfo (MarketStructureInfo) : The infirmation about the market structure from the price action.
foundZones (array) : All zones (order blocks and fair value gaps) to take action on.
zones (Zones) : The 'Zones' object that holds the current context.
priceAction (PriceAction type from mickes/PriceAction/5) : The 'PriceAction.PriceAction' object from the library 'PriceAction'.
settings (Settings) : set all values in this parameter to define the settings for the fair value gap creation.
Visual
Holds the visual elements or the zone.
Fields:
Boxes (array) : All the visual boxes.
Lines (array) : All the visual lines.
Labels (array) : All the visual labels.
Zone
Holds the values for visuals for the zone and to handle interactions (retests, false breakouts and breakouts).
Fields:
BaseTimeClose (series int) : The time close for the start of the zone.
FoundTimeClose (series int) : The time close for the zone when it's found.
ChartBaseTime (series int) : The time for the start of the zone according to the chart bar.
High (series float) : The maximimum price of the zone.
Low (series float) : The minimum price of the zone.
ReactionLimit (series float) : Set a factor (%) of the Average True Range (of length 14) that the total reaction must have.
TouchedZone (Zone type from mickes/Touched/17) : Zone object that will be created and sent to the library 'Touched'.
Visual (Visual) : An object that holds the visual elements for the zone.
SourceTimeframeSeconds (series int) : The 'timeframe.in_seconds' for the zone.
Direction (series int) : Defines if the found zone is bullish (1) or bearish (-1).
LatestRetestBarIndex (series int) : The latest 'bar_index' for a retest.
LatestFalseBreakoutBarIndex (series int) : The latest 'bar_index' for a false breakout.
LatestBreakoutBarIndex (series int) : The latest 'bar_index' for a breakout.
BarIndex (series int) : The chart's timeeframe 'bar_index'.
OriginType (series Type) : The 'Type' for the origin (order block or fair value gap).
Type (series Type) : The type of the zone.
Visible (series bool) : If the zone is drawn and not removed or re-drawn.
Zones
Holds the values for the charts zones.
Fields:
Zones (array) : The currently active zones.
Removes (array) : Reprsents the zones that will be replaced.
HiddenZones (array) : The currently hidden zones.
OrderBlockSettings
The settings specific for order block creation.
Fields:
TakeOut (series bool) : If the bas candle needs to be higher\lower than the previous candle (liquidity sweep\grab).
FairValueGap (series bool) : If there needs o be a fair value gap between the first and the last (third) candle of the order block.
ConsecutiveRisingOrFalling (series bool) : The candles in the reaction must consecutivly rise or fall (the 'hl2' must be rising/falling).
ReactionFactor (series float) : A factor of the Average True Range (of length 14) that the total reaction must have. A higher value will create fewer zones with a bigger reaction. And check the checkbox if you want the limit to be displayed.
ShowReaction (series bool) : Show a solid line for the reaction limit.
HideConsecutiveZones (series bool) : If multiple order blocks are found after each other only the first one will be found by the indicator.
FairValueGapSettings
The settings specific for fair value gap creation.
Fields:
ConsecutiveRisingOrFalling (series bool) : The candles in the reaction must consecutivly rise or fall (the 'hl2' must be rising/falling).
Strong (series bool) : If this is enabled it will force the FVG middle candle to have a higher/lower 'hl2' (middle of the entire candle) than the first candle's high.
HideConsecutiveZones (series bool) : If multiple order blocks are found after each other only the first one will be found by the indicator.
MinimumSizeFactor (series float) : A factor of the Average True Range (of length 14) that the size of the fair value gap must have.
Settings
The settings for the creation of order blocks and fair value gaps. You will need to set all the containing values in here.
Fields:
KeepHistoryZones (series bool) : Set to true if you want removed (from previous trend) zones to be displayed.
Bull (series color) : The color of bullish zones.
Bear (series color) : The color of bearish zones.
CreateCreationZone (series bool) : Set to true if you want a box with a border to be drawn at the creation of the zone. This is usefull when the zones comes from a higher timeframe, but not from a lower. If this is false the 'Draw()' function will start at 'time - time_close'.
AlertRetests (series bool) : Enable if you want alerts to fire when the 'Touched' library signals that a retest of the order block has occured.
AlertFalseBreakouts (series bool) : Enable if you want alerts to fire when the 'Touched' library signals that a false breakout of the order block has occured.
AlertBreakouts (series bool) : Enable if you want alerts to fire when the 'Touched' library signals that a breakout of the order block has occured.
AlertMessageFormat (series string) : Set the format of the fired alert uppon 'Touched' library signals. Need to be in the format of '{0} on order block from ...' where '{0}' is replaced with 'retest', 'false breakout' or 'breakout'.
Types (array) : All types that should be displayed.
FairValueGapSettings (FairValueGapSettings) : The settings for the creation of fair value gaps.
OrderBlockSettings (OrderBlockSettings) : The settings for the creation of order blocks.
MarketStructurePivot
Pivot The 'PriceAction.Pivot' for the market structure.
Fields:
BrokenBarIndex (series int)
Pivot (Pivot type from mickes/PriceAction/5)
MarketStructureInfo
Holds the needed market structure pivots needed for this library.
Fields:
LatestBreakOfStructure (MarketStructurePivot) : The latest break of structure (BOS) found by the 'PriceAction' library.
LatestChangeOfCharacter (MarketStructurePivot) : The latest change of character (CHoCH\CHoCH+) found by the 'PriceAction' library. Library

[ A L P H A X ] Structure Flow ProAlphaX Structure Flow Pro — Market Structure Engine, HPZ Order Blocks, Fair Value Gaps, Liquidity Sweeps, Equal Highs/Lows & SMC Confluence Signals
AlphaX Structure Flow Pro is a professional-grade Smart Money Concepts indicator built on a pivot-driven market structure engine that detects swing highs and lows in real time, identifies Market Structure Breaks with momentum Z-score validation and Body-Confirmed Breaks, discovers and scores Order Blocks using a proprietary High Probability Zone algorithm, maps Fair Value Gaps and Liquidity Sweeps as they form, identifies Equal Highs and Lows as liquidity pools, and synthesizes every active condition into a tiered SMC Confluence Score — all displayed on a live dashboard with 15+ alert conditions. Designed for traders who operate within the institutional Smart Money framework on any liquid instrument and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📸 Visual Overview
Full chart view showing Market Structure swing lines, MSB/BMS labels, HPZ Order Blocks with POC lines, FVG zones, Liquidity Sweep markers, Equal High/Low connections, SMC tiered entry labels, and the live Dashboard panel on XAUUSD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 The Market Structure Engine — How It Works
At the core of AlphaX Structure Flow Pro is a real-time pivot-based swing detection system that continuously tracks confirmed swing highs and swing lows using a configurable lookback window. Every confirmed pivot is labeled, connected, and used as the structural reference for all break logic downstream.
Each confirmed pivot produces:
A dotted swing line connecting the current and previous swing high or swing low — a live map of whether price is building higher highs and higher lows, or lower highs and lower lows
Small compact H and L labels at every swing point to mark the structural sequence clearly
From these pivots, the engine monitors two distinct types of structural break — each progressively more powerful than the last:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1 ─ Market Structure Break (MSB)
A confirmed close beyond the last tracked swing high or low, validated by a Momentum Z-Score filter . The Z-Score measures how many standard deviations the current bar's price change sits above or below its 50-bar mean. Only breaks where momentum is statistically significant above your configured threshold are accepted — low-conviction wicks, slow grinds, and false closes through structure are automatically ignored.
When a valid MSB fires:
A horizontal line is drawn from the breached pivot to the current bar, anchored at the exact structural level
An MSB ▲ or MSB ▼ label appears at the midpoint of that line
The breached swing level is reset so the engine never double-fires on the same break
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2 ─ Break of Market Structure (BMS)
A stricter and more powerful structural confirmation. In addition to closing beyond the pivot, BMS requires the breaking candle to have a body-to-range ratio above 50% — the break must be driven by a full-bodied candle, not a wick spike. BMS fires as a compact BMS label when it occurs without a simultaneous MSB, giving you a clear visual distinction between a momentum-confirmed break and a body-confirmed break.
How to read them together:
MSB — momentum is statistically significant but the candle body is below 50% — a valid break, treat it with context
BMS — the candle closed through structure with conviction — higher-probability structural shift
When both fire simultaneously, only the MSB label is shown as it already captures the event
Together, MSB and BMS form the structural backbone from which all Order Block discovery, FVG anchoring, and SMC Confluence scoring is triggered.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📦 Order Block Engine with HPZ Scoring
Every Market Structure Break triggers an automatic search backward through the preceding candles to identify the originating Order Block — the last candle moving against the direction of the break before price impulsed away. For a bullish MSB the engine finds the last bearish candle within the lookback window. For a bearish MSB it finds the last bullish candle.
Each discovered Order Block is assigned a Quality Score from 0 to 100 built from four independent factors:
Momentum Strength
The absolute magnitude of the Momentum Z-Score at the time of the MSB. Stronger impulsive moves away from the OB produce higher scores — a zone that launched a 3-sigma move ranks far above one that launched a 0.5-sigma drift.
Volume Percentile
The current bar's volume ranked against its last 100 bars using percentile rank. High-volume structural breaks indicate institutional participation — OBs discovered on high-volume breaks score significantly higher.
Candle Body Ratio
The proportion of the breaking candle that is body versus wick. A full-bodied impulsive candle away from the OB signals conviction. A wick-heavy or indecision candle signals a weaker origin.
OB Size Relative to ATR
The Order Block's height measured against the current 14-period ATR. Compact, well-defined OBs close to 1 ATR score proportionally — excessively large or tiny zones are naturally discounted.
These four factors are combined into the final Quality Score displayed on every OB label. Zones that score above your configured HPZ Threshold (default 75%) are promoted to High Probability Zones ⬡ and rendered with a brighter border and a distinct ⬡HPZ badge — the highest-conviction institutional zones on your chart.
HPZ Order Blocks rendered with enhanced borders and ⬡HPZ badge — standard OBs shown with dimmer styling for instant visual hierarchy
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Order Block Management
Active Order Blocks are not static — AlphaX Structure Flow Pro manages every zone dynamically bar by bar:
Live extension — every active, unmitigated OB extends its right edge forward to the current bar automatically, keeping your zones current at all times
Point of Control (POC) line — a dashed line at the exact midpoint of every OB, showing the most important price level within the zone
Mitigation detection — when price trades into the OB (low below OB bottom for bullish, high above OB top for bearish), the zone is marked as mitigated and dimmed to neutral gray
Historical mode — mitigated OBs remain visible on the chart dimmed for reference, letting you study how price reacted after mitigation
Present mode — mitigated OBs are deleted automatically, keeping the chart clean with only live unmitigated zones visible
Extend Broken OBs — optionally continue extending mitigated zones for up to 50 bars after mitigation for post-mitigation analysis
Overlap filtering — optionally hide new OBs that overlap existing active zones, preventing zone clustering in congested areas
OB Reliability tracker — the dashboard shows a live percentage of how many total OBs have been mitigated versus left untouched, giving you a real-time measure of how well price is respecting the zones on your current instrument and timeframe
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Fair Value Gaps (FVG)
AlphaX Structure Flow Pro detects Fair Value Gaps — three-candle imbalances where price moved so fast that the market left an unfilled gap between candle one's high/low and candle three's low/high.
Bullish FVG — candle three's low is above candle one's high — an upward gap in price action that the market may return to fill
Bearish FVG — candle three's high is below candle one's low — a downward gap
A minimum FVG size filter (ATR × your configured factor) prevents micro-gaps from cluttering the chart — only imbalances of meaningful size relative to current volatility are plotted.
Each FVG is drawn as a shaded box that extends forward bar by bar. When price trades back into the gap, the box is marked as filled and dimmed to neutral, stopping its extension. The dashboard tracks how many FVGs remain unfilled at all times, and the SMC Confluence engine uses unfilled FVGs above and below price as draw-on-liquidity targets when scoring entry signals.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Liquidity Sweeps
A Liquidity Sweep is one of the most important Smart Money patterns — institutions engineer price to run stop-loss liquidity beyond obvious highs or lows, then reverse sharply. AlphaX Structure Flow Pro identifies these events in real time.
Bullish Sweep — the candle's low breaks below the lowest low of the recent lookback window but the candle closes back above that level as a bullish close. Stops below recent lows were hunted, liquidity was absorbed, and price reversed upward.
Bearish Sweep — the candle's high breaks above the highest high of the recent lookback window but the candle closes back below that level as a bearish close. Stops above recent highs were hunted.
Each sweep is marked with a compact ⚡ label at the wick extreme. Sweeps feed directly into the SMC Confluence scoring system — a bullish sweep adds 20 points to the Bull SMC Score because it signals smart money accumulation, and a bearish sweep adds 20 points to the Bear SMC Score for the same reason in reverse.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
〰 Equal Highs and Equal Lows (EQH / EQL)
Equal Highs and Equal Lows are areas where price has printed two swing highs or two swing lows at nearly the same level — these levels represent clusters of resting stop-loss orders and are prime targets for institutional liquidity sweeps.
AlphaX Structure Flow Pro detects EQH and EQL automatically by comparing consecutive confirmed pivots. When two swing highs are within your configured ATR-scaled tolerance of each other, an EQH label and dotted connection line are drawn. When two swing lows match, an EQL label appears.
The ATR-scaled tolerance ensures the detection adapts to current market volatility — what counts as "equal" on a calm Asian session is different from a high-volatility London open, and the indicator adjusts automatically.
Equal Highs and Equal Lows marked with purple dotted lines — clear visual identification of stop-hunt targets above and below current price
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 SMC Confluence Scoring System
Every signal in AlphaX Structure Flow Pro feeds into a real-time SMC Confluence Engine that evaluates all active conditions simultaneously and produces a score from 0 to 100 for both the bullish and bearish side. Only scores that meet your configured minimum threshold generate a visible entry label — weak, ambiguous, or isolated setups never reach the chart.
Bull SMC Score Factors:
Market Structure Break (30 points) — an MSB bull fires adds 30 points as the core structural trigger. A BMS bull without simultaneous MSB adds 20 points.
Liquidity Sweep (20 points) — a bullish sweep on the current bar adds 20 points — smart money has absorbed sell-side liquidity
Near Bullish HPZ Order Blocks (up to 18 points) — two or more unmitigated bullish HPZ OBs within 2 ATR of price adds 18 points. One HPZ OB nearby adds 10 points.
Bearish FVG Draw on Liquidity (up to 10 points) — two or more unfilled bearish FVGs above price (magnets drawing price upward) adds 10 points. One adds 5 points.
Momentum Z-Score confirmation (up to 12 points) — strong upward momentum (Z > 2.0) adds 12 points. Moderate (Z > 1.0) adds 7. Mild (Z > 0.5) adds 3.
Volume ratio (up to 8 points) — volume spike (×2.0) adds 8, high volume (×1.3) adds 5, above average (×1.0) adds 2
Candle body (up to 6 points) — a bullish close with body ratio above 60% adds 6 points. Any bullish close adds 3.
Penalties — strong downward momentum (Z < −1.0) deducts 10 points. Two or more nearby bearish HPZ OBs deduct 8 points.
Bear SMC Score Factors are the exact mirror of the above, applied in reverse for all bearish conditions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Signal Tiers and Entry Labels
Every signal that clears the minimum SMC score threshold is classified into one of three tiers based on its final score:
S-Tier — score ≥ 70. Maximum confluence. All major factors aligned. The highest-confidence setups the engine produces.
A-Tier — score 55–69. Strong confluence with most major factors present.
B-Tier — score at or above your minimum threshold but below 55. Valid setup with meaningful confluence but fewer confirming factors.
Entry labels appear directly on the chart with the tier and score displayed:
▲ S-SMC (82) — bullish S-tier signal with a score of 82
▼ A-SMC (61) — bearish A-tier signal with a score of 61
Label color intensity reflects the tier — S-tier labels use the brightest bull or bear color, A-tier uses the primary color, B-tier uses the dimmed shade. This gives you instant visual priority — your eyes go to the brightest labels first.
A configurable Signal Cooldown prevents back-to-back signals within a set number of bars, eliminating label spam during fast-moving structural events.
S-tier and A-tier entry labels appearing below bars during bullish SMC confluence — label brightness reflects confidence tier at a glance
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🗓 Session Ranges
AlphaX Structure Flow Pro includes a full Session Range overlay for the four major trading sessions — London, New York, Tokyo, and Sydney — each independently toggleable with customizable colors and time windows.
Session boxes draw in real time as the session opens, expanding their high and low dynamically as price prints new extremes within the session. The session label updates its position to stay centered above the range. Each session closes when its time window ends, leaving the completed range as a permanent reference box for that period.
Use session ranges to:
Identify the high and low of a session as key liquidity targets for sweeps
Determine whether an MSB or OB formation occurred during a high-liquidity or low-liquidity window
Spot the London or New York open as a structural break origin
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Live Dashboard
The AlphaX Structure Flow Pro dashboard gives you a complete real-time readout of every active market condition in a compact panel — no need to visually scan the chart for each element individually.
Market Structure section:
MSB STATUS — shows whether a Bull MSB, Bear MSB, or no MSB is active on the current bar
BMS (BODY) — shows whether a body-confirmed structural break is active
MOMENTUM Z — current Z-score reading with direction label (STRONG / MODERATE / MILD / FLAT) and raw value
Order Blocks section:
ACTIVE OBs — total count of unmitigated Order Blocks currently on the chart
HPZ OBs — count of active High Probability Zone OBs, highlighted when any are present
OB RELIABILITY — live percentage of total OBs that have been mitigated since the indicator started tracking — your real-time measure of how well structure is being respected
Liquidity & Imbalance section:
LIQ SWEEP — shows whether a Bull or Bear liquidity sweep is active on the current bar
OPEN FVGs — count of unfilled Fair Value Gaps currently active
DRAW ON LIQ — shows whether price has unfilled FVGs drawing it upward, downward, or on both sides
SMC Confluence section:
BULL SMC SCORE — current bullish confluence score with tier label (S-TIER / A-TIER / B-TIER / LOW)
BEAR SMC SCORE — current bearish confluence score with tier label
HPZ PROXIMITY — shows whether price is near a Bull HPZ zone, Bear HPZ zone, both sides, or neither
Market Conditions section:
VOLUME — current volume classified as SPIKE / HIGH / NORMAL / DRY with the live ×ratio
ATR (14) — current 14-period ATR value in price terms
CANDLE BODY — current candle body ratio classified as STRONG / MODERATE / WEAK with percentage
Active Signal section:
SIGNAL — shows the active entry signal direction and tier, or NONE — the single most important row if you need a quick status check
Dashboard position (Top Left / Top Right / Bottom Left / Bottom Right) and text size (Tiny / Small / Normal / Large) are fully configurable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Identifying Low-Quality Conditions — When NOT to Trade
Knowing when to stay out is just as important as knowing when to enter. AlphaX Structure Flow Pro gives you clear signals that the market is not in a tradeable condition:
How to identify unfavorable conditions:
No MSB or BMS on the dashboard — if the MSB STATUS row shows NONE, there is no confirmed structural trigger. No structural break means no Order Block discovery, and no SMC signals should be acted on.
Bull and Bear SMC Scores both show LOW — when neither side can build enough confluence to reach even B-tier, the market is either ranging, choppy, or lacking institutional participation. Wait for a clear dominant side to emerge.
OB RELIABILITY is very high (above 80–90%) — when nearly every OB is being quickly mitigated, price is not respecting structure and the market is in a sweep-and-reverse or noise regime. Reduce position size or stand aside.
No SMC entry labels appearing — the confluence engine is running on every bar. If no labels are printing even after MSB events, the filters are doing their job blocking low-quality setups. Do not lower the threshold to force signals — wait for real confluence.
DRAW ON LIQ shows BOTH SIDES — unfilled FVGs above and below simultaneously means price is in the middle of a contested range with equal magnets in both directions. No clean directional edge exists.
MOMENTUM Z reads FLAT on the dashboard — flat momentum at a structural level often means a failed break rather than a true MSB. Treat these events with extra caution.
What to do during unfavorable conditions:
Wait for a clean MSB or BMS to set the directional bias before considering any entry
Look for one dominant side in the SMC Confluence section — both Bull and Bear scores being low simultaneously is a ranging signal
Watch for a liquidity sweep followed immediately by an MSB in the same direction — that sequence is one of the highest-probability SMC setups and will produce a strong confluence score when it fires
Consider switching to a higher timeframe to find cleaner structure — if the current timeframe is printing rapid alternating MSBs, the higher timeframe trend will show you the dominant direction
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX Structure Flow Pro — Step by Step
Step 1 — Read the Dashboard
Check MSB STATUS and BMS — is there a live structural break?
Check Bull and Bear SMC Scores — is one side clearly dominant with a B-tier or higher score?
Check DRAW ON LIQ — are unfilled FVGs pulling price in one clear direction?
If no clear dominant side and no MSB → do not trade. Wait for structure.
Step 2 — Identify the Structural Trigger
An MSB ▲ or BMS bull sets your bullish directional bias
An MSB ▼ or BMS bear sets your bearish directional bias
Do not enter blindly on the MSB label alone — use it to set context, then wait for a tiered SMC signal to confirm
Step 3 — Enter on a Tiered SMC Signal
Wait for a ▲ SMC or ▼ SMC label to appear with a tier of B or higher
Prioritize S-tier and A-tier signals — these have the most factors aligned
Check that an unmitigated HPZ Order Block is nearby in the direction of the trade — HPZ proximity is displayed on the dashboard in real time
Place your stop loss beyond the most recent swing low (for longs) or swing high (for shorts), or just beyond the relevant OB's outer edge
Step 4 — Use FVGs and OBs as Targets and Re-Entry Zones
Unfilled FVGs in the direction of the trade are natural draw-on-liquidity targets — they show you where price is likely being pulled toward
Mitigated OBs (shown dimmed in Historical mode) mark areas where price has already visited and absorbed — useful as reference for prior institutional activity
If price pulls back into an unmitigated bullish OB without triggering a new bearish MSB, that is a potential re-entry zone aligned with the original structural break
Step 5 — Monitor for Structural Invalidation
If an opposing MSB fires after your entry, the structure has shifted — close or reduce your position
If the SMC Score for your trade direction drops to LOW on the dashboard without a new signal, momentum is fading
A liquidity sweep against your position that does not produce a reversal SMC signal is a warning — tighten your stop
Step 6 — Watch for Equal Highs/Lows as Exit Targets
EQH levels above price during a bull trade are natural exit zones — institutions often sweep equal highs as final liquidity grabs before reversal
EQL levels below price during a bear trade serve the same purpose
Consider taking partial profit as price approaches an EQH or EQL level, then hold the remainder for a potential sweep and continuation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
🔬 Pivot-based market structure engine with configurable swing lookback — tracks confirmed swing highs and lows in real time
📈 MSB detection with Momentum Z-Score validation — filters out low-conviction structural breaks statistically
💪 BMS detection with candle body ratio confirmation — only full-bodied closes through structure qualify
📦 Order Block discovery anchored to every MSB — automatically finds the originating institutional candle
⬡ Proprietary HPZ Quality Score (0–100) — four-factor scoring system promotes the highest-conviction zones to High Probability Zone status
📍 Point of Control line on every Order Block — shows the midpoint of the zone for precision entries
🔄 Dynamic OB management — live extension, mitigation detection, Historical and Present display modes, overlap filtering, and broken OB extension
📊 Fair Value Gap detection with ATR-scaled minimum size filter — bullish and bearish imbalances mapped and tracked until filled
⚡ Liquidity Sweep detection — wick-beyond plus close-inside logic identifies institutional stop hunts in real time
〰 Equal Highs and Equal Lows detection with ATR-scaled tolerance — automatic identification of resting liquidity pools
🧠 Multi-factor SMC Confluence Scoring Engine — synthesizes structure, sweeps, HPZ OBs, FVG draw, momentum, volume, and candle body into a single 0–100 score per side
🏆 Three-tier signal classification — S-Tier (≥70), A-Tier (55–69), B-Tier (threshold to 54) with color-coded label intensity
⏱ Signal cooldown timer — configurable minimum bars between signals to eliminate label spam
✅ Optional volume confirmation filter — require minimum volume ratio before any signal fires
🗓 Four-session range overlay — London, New York, Tokyo, and Sydney each independently toggleable with custom colors and time windows
📋 Live 7-section dashboard — MSB/BMS status, momentum Z, OB counts, HPZ proximity, FVG draw direction, SMC scores, volume, ATR, and active signal — all in one panel
🎨 Fully customizable color theme — 13 configurable colors covering bull, bear, neutral, FVG, sweep, EQL, and dashboard elements
🔔 15+ alert conditions — MSB bull/bear, BMS bull/bear, S/A/B-tier bull signals, S/A/B-tier bear signals, any SMC signal, bull/bear sweeps, bull/bear FVGs, and MSB + HPZ confluence alerts
⚙ Fully configurable — every lookback, threshold, score, toggle, color, and session window adjustable from the settings panel
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
Market Structure
Pivot Lookback — bars on each side required to confirm a swing high or low (default: 7, range: 3–21)
MSB Momentum Z-Score — minimum standard deviation threshold for a valid Market Structure Break (default: 0.5)
Show MSB Lines & Labels — toggle visibility of MSB/BMS lines and labels
Show Structure Swings — toggle visibility of swing lines and H/L pivot labels
Detect Break of Market Structure (BMS) — enable or disable body-confirmed structural break detection
Order Blocks
Max Active OBs — maximum number of unmitigated Order Blocks kept on the chart at once (default: 10)
OB Lookback (candles) — how many candles back the engine searches for the originating OB after an MSB (default: 10)
Extend Broken OBs — continue extending mitigated OBs for up to 50 bars after mitigation
Hide Overlapping OBs — skip new OBs that overlap existing active zones
Display Mode — Historical (keep mitigated OBs dimmed) or Present (delete mitigated OBs automatically)
HPZ Threshold Score (%) — minimum quality score required for HPZ promotion (default: 75%)
Show OB Point of Control — toggle the midpoint POC dashed line on Order Blocks
Liquidity & Imbalance
Show Fair Value Gaps — toggle FVG detection and display
Min FVG Size (ATR × factor) — minimum gap size as a multiple of ATR to qualify as a valid FVG (default: 0.05)
Show Liquidity Sweeps — toggle sweep detection and ⚡ markers
Sweep Lookback (bars) — lookback window for determining the recent high/low that is swept (default: 20)
Show Equal Highs / Lows — toggle EQH and EQL detection and display
EQL Tolerance (ATR × factor) — how close two pivots must be to qualify as equal, scaled to ATR (default: 0.1)
Smart Money Confluence (SMC)
Enable SMC Confluence Engine — master toggle for the scoring system and all entry labels
Min SMC Score to Signal — minimum confluence score required to display an entry label (default: 30)
Signal Cooldown (bars) — minimum bars between consecutive signals in the same direction (default: 3)
Require Volume Confirmation — only fire signals when volume ratio meets the minimum threshold
Min Volume Ratio — minimum volume-to-SMA ratio required when volume filter is enabled (default: 0.7)
Sessions
Show Session Ranges — master toggle for the session overlay
London / New York / Tokyo / Sydney — independently toggle each session with configurable time window and color
Dashboard
Show Dashboard — toggle the dashboard panel on or off
Position — Top Left / Top Right / Bottom Left / Bottom Right
Size — Tiny / Small / Normal / Large
Appearance
Label Size — controls the size of all MSB, BMS, sweep, EQH/EQL, and entry labels (Tiny / Small / Normal)
Colors
Bull Primary / Bright / Dim — three shades of the bullish color family for OBs, labels, and signals
Bear Primary / Bright / Dim — three shades of the bearish color family
Neutral / Neutral Light — colors for mitigated zones and inactive states
Text Light — color for dashboard row labels
Dashboard Background — background color of the dashboard panel
FVG Bull / Bear Color — colors for bullish and bearish Fair Value Gap zones
Liquidity Sweep Color — color for sweep ⚡ labels
Equal Hi/Lo Color — color for EQH and EQL lines and labels
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions
Bull Market Structure Break — fires on every bullish MSB
Bear Market Structure Break — fires on every bearish MSB
Bull Break of Market Structure (Body Close) — fires on every bullish BMS
Bear Break of Market Structure (Body Close) — fires on every bearish BMS
S-Tier Bull SMC Signal — bullish signal with score ≥ 70
A-Tier Bull SMC Signal — bullish signal with score 55–69
B-Tier Bull SMC Signal — bullish signal below 55 but above minimum threshold
S-Tier Bear SMC Signal — bearish signal with score ≥ 70
A-Tier Bear SMC Signal — bearish signal with score 55–69
B-Tier Bear SMC Signal — bearish signal below 55 but above minimum threshold
Any SMC Signal — fires on any bullish or bearish signal regardless of tier
Bull Liquidity Sweep — wick below recent lows with bullish close
Bear Liquidity Sweep — wick above recent highs with bearish close
Bullish Fair Value Gap — new bullish FVG formed
Bearish Fair Value Gap — new bearish FVG formed
Bull MSB + HPZ Confluence — bullish MSB with at least one nearby unmitigated HPZ OB
Bear MSB + HPZ Confluence — bearish MSB with at least one nearby unmitigated HPZ OB
All alert messages include {{ticker}} and {{interval}} placeholders for clean webhook and bot integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Recommended Settings by Use Case
The default configuration is tuned for intraday trading on liquid instruments including XAUUSD, forex majors, and indices on M1 to M15 timeframes.
For tighter, higher-conviction signals:
Increase Min SMC Score to 45–55 — only S-tier and strong A-tier setups fire
Enable Require Volume Confirmation and set Min Volume Ratio to 1.0–1.3
Increase Pivot Lookback to 9–12 for larger, more significant swing points
Set HPZ Threshold to 80% to tighten HPZ qualification
For more signals and aggressive scalping:
Reduce Min SMC Score to 20–25
Reduce Signal Cooldown to 1–2 bars
Reduce Pivot Lookback to 3–5 for faster swing detection
Keep Volume Confirmation off
For higher timeframes (H1, H4, Daily):
Increase Pivot Lookback to 10–15
Increase OB Lookback to 15–20
Increase Min SMC Score to 40–50
Increase Sweep Lookback to 30–50
For ranging or news-driven markets:
Enable Hide Overlapping OBs to reduce zone clutter
Switch Display Mode to Present to keep only live zones visible
Monitor DRAW ON LIQ on the dashboard — if both sides show FVGs, avoid directional trades
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
🥇 Smart Money Concepts traders — built specifically around the MSB → OB → FVG → Sweep framework that institutional-style traders use
📉 Forex and Gold traders — fully applicable to XAUUSD, forex majors and minors, and all liquid currency pairs
📊 Index traders — works on US30, NAS100, SPX500, DAX, and all major equity indices
🧠 Systematic and rule-based traders — the confluence scoring system provides a quantitative, objective framework rather than purely subjective visual reads
📈 Traders who want one complete SMC system — structure, OBs, FVGs, sweeps, EQH/EQL, sessions, scoring, and dashboard in a single indicator rather than layering five separate tools
⚠ Traders who struggle with overtrading — the minimum score filter, cooldown, and volume gate physically prevent low-quality signals from reaching the chart
🔔 Alert-driven traders and bot operators — 17 alert conditions with clean webhook-ready message formatting cover every meaningful event the indicator can detect
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
Session range features use the time zone of each configured session string — set your London and New York session times to match your chart's time zone if ranges appear offset
The Momentum Z-Score is calculated over a 50-bar rolling window — on very short histories or immediately after a chart loads, early bars may have lower Z-Score values until the window fills
OB Reliability percentage starts from zero when the indicator first loads and builds over time as OBs are discovered and mitigated — it is most meaningful after a full session of price action
The SMC Confluence Engine evaluates conditions on bar close — all signals are non-repainting and confirmed on the closed bar
With max_boxes_count, max_lines_count, and max_labels_count each set to 500 and max_bars_back at 500, on very low timeframes with extended chart history the oldest visual elements may be automatically removed by PulseWire's rendering limits — this is a platform constraint, not an indicator limitation
The HPZ proximity check uses a 2 ATR radius around the current close price — zones further away than 2 ATR are not counted in the SMC score even if they are unmitigated and visible on the chart
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who demand structure, confluence, and precision from their Smart Money analysis. Indicator

Dominance Sweep Tracker [JOAT]Dominance Sweep Tracker
Introduction
Dominance Sweep Tracker (DST) is an open-source, institutional-grade order flow engine that combines three detection layers — market structure dominance, liquidity sweep identification, and order block entry confirmation — into a single, unified trading framework. It tracks confirmed swing pivots, identifies when body-close breaks through those levels signal a structural shift in market dominance, detects liquidity sweeps where wicks pierce prior pivots and price closes back inside, and marks the last opposing candle before each sweep as the entry order block. ATR-based trade visualizations with risk/reward boxes and per-session win rate tracking complete the system.
The core problem DST solves is the fragmentation of ICT order flow analysis across multiple manual steps. Traders watching for structural dominance shifts, hunting sweeps of prior swing liquidity, and locating order block entries typically need to perform those three steps separately, often missing the interaction between them. DST connects all three into a single detection pipeline that fires on confirmed bars, identifies the relevant entry zone automatically, and tracks the resulting trade outcome against configurable TP and SL levels across four distinct trading sessions.
Core Concepts
1. Swing Pivot Detection
DST uses Pine Script's built-in ta.pivothigh() and ta.pivotlow() functions to identify confirmed swing highs and lows. These are inherently non-repainting — a pivot is only confirmed after the required number of bars on both sides have formed. The most recent confirmed swing high and low are stored as the active liquidity levels.
2. Market Dominance Detection
A dominance shift occurs when a bar's body — not its wick — closes beyond a confirmed swing level. Bullish dominance is confirmed when the close exceeds the most recent swing high. Bearish dominance is confirmed when the close falls below the most recent swing low. This body-close requirement eliminates wick-based false breaks and isolates genuine structural displacement:
bool bullDom = close > swingHi and open > swingHi
bool bearDom = close < swingLo and open < swingLo
3. Liquidity Sweep Detection
A sweep occurs when a bar's wick pierces a prior swing level and the close returns back inside. DST applies a minimum wick depth filter (default: 0.2 ATR) to avoid noise from trivial touches. A bullish sweep fires when the low exceeds the swing low but the close is above it. A bearish sweep fires when the high exceeds the swing high but the close is below it. Both are gated on barstate.isconfirmed.
4. Order Block from Last Opposing Candle
When a sweep is confirmed, DST scans back through recent bars to identify the last candle that moved in the opposite direction of the sweep. For a bullish sweep setup (price swept below a low and recovered), the last bearish candle before the sweep is marked as the entry order block. This zone represents the origin of the move that created the liquidity pool — the level where institutional positioning likely occurred.
5. Session-Aware Trade Tracking
Each detected signal is tagged with the trading session active at that bar (Asia, London, NY, or Off-Session). ATR-based stop loss and take profit levels are calculated at signal time and visualized as color-coded boxes. Outcome is tracked against those levels, and win/loss counters are maintained per session for statistical context.
Features
Swing Pivot Tracking: Confirmed swing highs and lows rendered as horizontal reference lines — the primary liquidity pool levels
Body-Close Dominance Detection: Structural breaks confirmed only on candle body close beyond swing level, eliminating wick-false-break noise
Liquidity Sweep Detection: Wick-beyond, close-inside detection across all recent pivots with configurable ATR depth filter
ATR Wick Filter: Minimum wick penetration depth prevents noise from triggering sweep signals on trivial pokes
Order Block Identification: Automatic scan of last opposing candle before each sweep — rendered as a colored zone box
OB Touch Signal: Secondary signal fires when price returns to touch an active order block zone
EMA 750 Trend Filter: Optional filter that requires price to be on the correct side of the EMA 750 for long and short signals
ATR-Based TP/SL Boxes: Risk (SL) and reward (TP) areas visualized as colored boxes from entry — default 1.5× ATR stop, 3:1 reward
Session Detection: Asia, London, NY, and Off-Session windows (configurable) tag each signal for session-specific tracking
Per-Session Win Rate: Independent win/loss/total counters for all four sessions displayed in the dashboard
Non-Repainting: All signals gated on barstate.isconfirmed; ta.pivothigh/ta.pivotlow inherently confirmed
Dashboard (Top Right): Session win rates for Asia, London, NY, and Off-Session with color-coded performance indicators
BOS Dominance Labels: "BOS ▲" and "BOS ▼" dominance labels replace simple B/S markers — clearly communicates the direction of each confirmed structural break on the chart
Order Block Dominance Labels: "BULL DOM" and "BEAR DOM" labels placed inside order block boxes at creation — identifies the structural context in which each OB was formed
Dominance Candle Tint: Candles colored teal when dominant bull conditions are active, rose when dominant bear — encodes structural dominance state directly into price bar color
Upgraded TP/SL Pip Labels: SL and TP labels now include session name and RR ratio in the format "142p TP 3.0R | London" — full trade context visible directly on the chart
Sweep and Dominance Shift Counters: Sweep counter and dominance shift counter displayed in the dashboard — cumulative structural activity metrics updated on each confirmed event
Expanded Dashboard (8 Rows): Dashboard expanded to 8 rows — now includes sweep count and dominance shift count alongside existing session win rate data
Input Parameters
Pivot Settings:
Swing Lookback: Number of bars on each side required to confirm a pivot (default: 5)
Sweep Settings:
Min Sweep Wick (ATR×): Minimum wick depth relative to ATR (default: 0.2)
Sweep Lookback Bars: How many recent bars to scan for swing levels to test against (default: 50)
Order Block:
OB Scan Back: How far back to search for the last opposing candle (default: 10)
OB Max Active: Maximum number of live order blocks displayed simultaneously (default: 5)
Filter Settings:
EMA Trend Filter: Require price on correct side of EMA 750 for signal confirmation (default: enabled)
EMA Length: Period for the trend EMA (default: 750)
Risk Management:
ATR Length: Period for ATR calculation (default: 14)
ATR SL Multiplier: Stop loss distance as ATR multiple (default: 1.5)
Reward:Risk Ratio: Take profit as multiple of stop distance (default: 3.0)
Session Settings:
Timezone, Asia/London/NY window hours — fully configurable per session
How to Use This Indicator
Step 1: Identify the Current Structural Context
Swing highs and lows on the chart represent the live liquidity pools. Price above the most recent swing high in an uptrend signals buy-side liquidity accumulation. Price below swing lows signals sell-side liquidity. The dominance signal (filled triangle) fires when price body-closes through a swing, marking a genuine structural shift.
Step 2: Monitor for Sweep Signals
When a sweep label appears, price has taken liquidity from a swing level and rejected back inside. This is the setup precondition — the liquidity event has occurred. The order block zone identified at that bar is the entry reference level.
Step 3: Enter at the Order Block
The last opposing candle before the sweep is rendered as a box. Price returning to that zone represents a potential re-entry into the displacement move. Combine with EMA 750 trend direction for higher-probability setups.
Step 4: Manage the Trade with TP/SL Boxes
ATR-based SL and TP boxes extend from the entry bar. Stop loss is set 1.5× ATR below (long) or above (short) entry. Take profit is at 3:1 reward by default. Both are fully configurable.
Step 5: Review Session Performance
The per-session win rate table highlights which killzones have historically produced the best outcomes on your instrument and timeframe. Use this to weight your activity toward higher-performing sessions.
Indicator Limitations
Swing pivot detection requires a minimum number of confirmed bars on both sides of the pivot. On very fast timeframes (sub-1 minute), pivot lookback may be impractically long relative to the session window
The order block scan selects the last opposing candle within a fixed lookback window. In trending conditions with extended single-direction candle runs, no opposing candle may be found within the scan range
Session win rate counters reset when the indicator is removed and re-added, or when the chart is refreshed with no history. They are valid only within the current chart session
The EMA 750 filter is based on a 750-period EMA. On shorter timeframes, 750 bars may not be available on instruments with limited history, causing the EMA to be inaccurate until sufficient data loads
ATR-based TP and SL levels are static from entry — they do not trail or adjust. Volatile markets may require manual adjustment of the ATR multiplier for realistic risk sizing
Originality Statement
DST integrates three distinct ICT order flow concepts — structural dominance, liquidity sweeps, and order block entry — into a unified detection and tracking pipeline. This combination is original for the following reasons:
The three-layer detection pipeline (dominance → sweep → order block) processes each concept in sequence, where a sweep only becomes significant in the context of the structural level it targets, and the order block is identified relative to that sweep specifically — not as an independent scan
The body-close dominance confirmation (requiring the entire body, not just the wick, to close beyond the swing level) is a stricter filter than standard breakout detection, reducing false structural break signals in choppy conditions
Per-session win rate tracking, maintained independently for four distinct trading windows within a single indicator, provides empirical context for which market periods generate the most consistent outcomes on a given instrument
The order block touch signal — a secondary detection layer that fires when price returns to interact with a previously identified OB zone — closes the loop between zone creation and zone interaction without requiring separate indicators
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Liquidity sweeps and order block zones are historical reference levels. The appearance of a sweep signal does not guarantee price continuation in any direction. Session win rates are based on historical bar data and do not predict future performance. Always apply proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Indicator

Impulse Structure Zones [JOAT]Impulse Structure Zones
Introduction
Impulse Structure Zones (ISZ) is an open-source, institutional-grade zone engine that detects statistically significant price impulses using a Z-Score methodology, identifies the origin candle of each impulse as an order block, and grades each zone using a multi-factor wick rejection scoring system. Bullish and bearish zones are tracked in parallel arrays with full lifecycle management — creation, extension, mitigation detection, and rejection confirmation — all rendered as clean, non-repainting boxes on the chart with a mid-line bisecting each zone.
The core problem ISZ solves is the manual process of locating high-probability order block zones on a chart. Institutional price delivery frequently originates from specific candles where large orders were placed — the last opposing candle before a strong directional move. ISZ automates the detection of those moves, marks the origin candles, and then monitors each zone to fire a graded rejection signal when price returns to test the level. Grades A, B, and C communicate signal quality based on wick dominance, proportional wick depth, volume confirmation, and candle size relative to ATR.
Core Concepts
1. Z-Score Impulse Detection
Price change is measured bar-by-bar as a percentage move and normalized into a Z-Score against a rolling mean and standard deviation window:
float pxChg = (close - close ) / close * 100.0
float zscore = (pxChg - avgChg) / math.max(stdChg, 0.0001)
A bar qualifies as an impulse when the absolute Z-Score exceeds the user-defined threshold (default: 1.5). This isolates moves that are statistically unusual relative to recent activity — the same principle used in quantitative strategies to filter meaningful displacement from noise. All signals are gated on barstate.isconfirmed to prevent repainting.
2. Order Block Identification
When a bullish impulse is confirmed, ISZ scans back through recent bars to locate the last bearish candle (close < open) before the move. That candle's high and low become the order block zone boundaries. For bearish impulses, the last bullish candle is used. This matches the ICT definition of an order block — the final imbalance candle before institutional displacement.
3. Zone Lifecycle Management
Each zone is stored as a user-defined type (UDT) containing the box object, mid-line, price boundaries, birth bar, direction, mitigation flag, and rejection flag. Zones extend rightward on each bar until price closes beyond the zone (mitigation), at which point the box is frozen and marked as mitigated. A maximum zone count is enforced and oldest zones are trimmed to maintain chart performance.
4. A/B/C Rejection Grading
When price returns to test a live zone and a rejection candle forms, ISZ grades the signal quality using four independent scoring factors:
Wick dominance ratio: The rejection wick length divided by candle body size
Proportional wick depth: The wick as a percentage of the total candle range
Volume confirmation: Current bar volume compared to the 20-bar average
Candle size vs ATR: Whether the rejection candle is of meaningful size relative to recent volatility
A total score of 6+ = Grade A, 4-5 = Grade B, below 4 = Grade C. Grade is displayed as a label on the rejection bar.
Features
Z-Score Impulse Engine: Statistically filters price moves against a rolling mean/standard deviation window — configurable length and threshold
Automatic Order Block Detection: Last opposing candle before each confirmed impulse identified and stored as a zone
Bidirectional Zone Tracking: Bullish (demand) and bearish (supply) zones managed in separate arrays with independent colors
A/B/C Rejection Grading: Four-factor scoring system labels each zone test with a quality grade
Zone Mitigation Detection: Zones that are fully closed through are frozen and visually distinguished from active zones
Mid-Line Reference: Each zone box includes a dashed mid-line at the 50% level — institutional equilibrium reference
ATR Proximity Filter: Rejection signals only fire when price is within a configurable ATR multiple of the zone
Volume Confirmation: Optional volume filter requires above-average volume at rejection for grading
Non-Repainting: All signals gated on barstate.isconfirmed — no look-ahead bias
Zone History Limit: Oldest zones automatically removed when the maximum count is reached to maintain performance
Dashboard (Top Right): Active bull/bear zone counts, last signal grade, last impulse Z-Score, and ATR — updated on each bar
Live Z-Score Candle Gradient Coloring: Impulse candles colored teal or rose based on Z-Score strength — immediately identifies statistically significant displacement bars on the chart
ATR Band Plots Around EMA 750: Visual upper and lower extremity zones drawn as ATR-based bands around the 750-period EMA — communicates when price is at macro stretch relative to the long-term anchor
RR Trade Boxes on Rejection Signals: Auto-generated SL/TP boxes on every rejection signal — 1.5× ATR stop loss with 3:1 reward-to-risk ratio, extending forward from the signal bar
Session Win Rate Tracking: Asia, London, and NY win rates tracked independently for rejection trades — outcome recorded against each signal's ATR-based TP/SL levels
Best Session Highlight: Dashboard automatically identifies and highlights the highest win-rate session across all three windows
Expanded Dashboard (9 Rows): Dashboard expanded to 9 rows — now includes live Z-Score reading, total impulse count, and full session win rate breakdown alongside existing zone and signal data
Input Parameters
Z-Score Settings:
Z-Score Length: Rolling window for mean and standard deviation calculation (default: 20)
Z-Score Threshold: Minimum absolute Z-Score required to qualify as an impulse (default: 1.5)
Zone Settings:
Max Active Zones: Maximum number of zones tracked simultaneously per direction (default: 8)
Bull Zone Color / Bear Zone Color: Independent colors per direction
Rejection Settings:
ATR Proximity (multiplier): How close price must be to a zone to trigger rejection check (default: 0.5)
ATR Length: Period for ATR calculation (default: 14)
Require Volume Confirmation: Toggle — above-average volume required for Grade A
How to Use This Indicator
Step 1: Identify Active Zones
Active bullish zones (demand) appear below price in teal. Active bearish zones (supply) appear above price in rose. Mitigated zones are visually dimmed. Focus on zones that have not yet been tested — these are the most relevant levels for future price interaction.
Step 2: Wait for Price to Return to the Zone
ISZ does not generate entry signals on impulse creation. It monitors active zones for return tests. When price pulls back into a zone, watch for the rejection grading label to appear.
Step 3: Grade the Signal
An A-grade rejection at a fresh, unmitigated zone is the highest-quality setup. B-grade is acceptable with additional confluence. C-grade rejections at already-tested zones carry the least weight. Use the grade in combination with your own bias and higher-timeframe analysis.
Step 4: Monitor the Dashboard
The dashboard shows active zone counts, last Z-Score, last grade, and ATR. A high Z-Score at impulse creation indicates an unusually strong move — those zones tend to attract more significant future tests.
Indicator Limitations
Z-Score impulse detection requires sufficient historical bars (at least 2× the Z-Score length) to produce accurate statistics — on very short chart histories the first few zones may form under unstable conditions
Order block detection scans back a fixed number of bars (configurable). In fast-moving markets where multiple candles are the same color, the scan may place the zone further back than an analyst would manually
Rejection grading uses volume data. On instruments with synthetic or unreliable volume (e.g., some CFDs, synthetic indices), the volume scoring component will not reflect true market activity
Zones do not account for gap fills, overnight moves, or after-hours sessions — a zone that appears unmitigated on the chart may have been effectively traded through outside of regular hours depending on the instrument
The A/B/C grading is a quantitative scoring system, not a certainty measure. Grade A signals do not guarantee price continuation in the expected direction
Originality Statement
ISZ combines Z-Score statistical impulse detection with origin-candle order block identification and a multi-factor rejection grading system in a single, self-contained indicator. This combination is original for the following reasons:
The use of a Z-Score normalized against a rolling mean and standard deviation — rather than a fixed pip or percentage threshold — makes impulse detection adaptive to current market volatility. The same threshold parameter behaves consistently across instruments and timeframes without requiring manual recalibration
The A/B/C grading system applies four independent quantitative factors (wick dominance, wick proportion, volume, candle size) simultaneously to classify signal quality at the point of zone interaction — rather than simply marking every return to a zone as equal
Zone lifecycle management (create → extend → mitigate → reject → trim) is handled automatically through UDT arrays with in-place field mutation, eliminating the need for manual zone maintenance or re-drawing
The combination of impulse detection, zone creation, and rejection grading in a single engine — with a unified dashboard — removes the need to layer multiple indicators to accomplish the same workflow
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Order block zones are historical reference levels and do not guarantee that price will react at those levels. A/B/C grades reflect quantitative scoring and do not predict future price movement. Always apply proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Indicator

FVG with Probabilities | GainzAlgoFVG with Probabilities
The FVG Quality Engine v5.1 is a high-performance, institutional-grade toolkit specifically designed for the volatile nature of 0DTE options and lower-timeframe scalp trading.
Unlike standard gap detectors, this engine utilizes a complex scoring model to quantify the probability of a Fair Value Gap (FVG) holding or failing in real-time.
The Theory of the Fair Value Gap (FVG)
At its core, a Fair Value Gap represents a market imbalance. It is a three-candle sequence where price moves so rapidly that it leaves behind a structural void where only one side of the market was efficiently filled.
The Displacement: An FVG is only as strong as the energy behind it.
This indicator requires displacement, meaning the candle must be large relative to volatility (ATR) and possess a solid body with minimal wicks.
The Rebalance Magnet: Price has a natural tendency to return to these imbalances to find fair value.
The engine tracks the Consequent Encroachment (CE), or the 50% midpoint of the gap, which often serves as the most sensitive reaction level.
Inversion (IFVG): When price fails to respect an FVG and instead closes with displacement on the opposite side, the gap flips.
A bullish FVG that is closed through becomes a bearish resistance zone, known as an Inversion FVG.
The Quality Scoring Model: Probabilities and Values
The indicator calculates a probability score for every gap (clamped between 4% and 85%) to help distinguish between low-quality noise and high-confluence setups. This is a weighted logit model based on eight key factors:
P/D Alignment (1.5x Weight): Checks if a long is in discount or a short is in premium relative to recent swing points.
Market Structure (1.3x Weight): Alignment with a recent Break of Structure (BOS).
Size/ATR Ratio (1.2x Weight): Gaps that are too small or excessively large relative to volatility are downgraded.
Trend & HTF (1.0x Weight): Alignment with the 20/50 EMA stack and the 200 HTF EMA.
Volatility Regime (0.9x Weight): Higher scores during expansion, reduced scores during compression.
Volume (0.8x Weight): Uses Relative Volume (RVOL) to confirm institutional participation.
Killzones (0.7x Weight): Gaps formed during London or New York sessions receive a boost.
Comprehensive Menu Inputs
FVG Detection & Displacement
Min FVG Size (ATR x): Controls sensitivity. Default of 0.3 ATR ensures meaningful gaps only.
Require Displacement: Middle candle must meet a minimum body-to-range ratio (default 0.6).
IFVG Rules (The Flip Logic)
Track IFVGs: Enables conversion of failed gaps into inversion zones.
Min Close Dist: Requires price to close at least 0.3 ATR beyond the gap.
Req Aligned BOS: Strict filter requiring a structural break for IFVG validation.
Signal Engine
Signal Mode
Choose between Trend Only, Reversal Only, or Both.
Require Confirmation: Waits for opposing displacement after FVG/OB/Sweep interaction.
Trigger on CE Tap: Signals when price taps the 50% level of a high-quality FVG.
Time-of-Day Filter
Skip First/Last N Minutes: Avoids open volatility and end-of-day noise.
Skip Lunch: Filters out low-volume periods between 11:30 and 13:30 NY time.
How to Use the Indicator
Step 1: Identify the Bias: Use the dashboard to determine if the setup is trend or reversal. Look for EMA alignment: 20 EMA above 50 EMA and price above 200 EMA.
Step 2: Filter by Quality: Focus only on gaps labeled H (High) or M (Medium). High-quality gaps (>65%) indicate strong confluence.
Step 3: Entry Confluence: The best entries occur at A+ tier setups. These happen when price retests a high-scoring FVG or OB within a killzone and is followed by confirmation.
Step 4: Managing Inversions: If a bullish gap fails, do not ignore it. Watch for it to flip into a purple IFVG, acting as resistance for potential reversal or continuation.
Indicator

Displacement Forge [JOAT]Displacement Forge
Introduction
Displacement Forge is an open-source order block detection engine built on Z-Score impulse analysis. It identifies statistically significant price displacements — moves that exceed a configurable standard deviation threshold relative to recent price change history — and marks the candle immediately preceding each displacement as an Order Block Zone. Order blocks represent the price ranges from which institutional order flow originates. Price regularly returns to these zones to fill remaining orders, and Displacement Forge identifies and tracks each one, monitors for zone reactions, and records cumulative rejection statistics.
The problem order block analysis solves is entry precision. A trend bias tells you direction. An order block tells you at what price the institutions that created that trend loaded their positions. Returning to those prices to enter alongside institutional flow — rather than chasing moves already in progress — is the conceptual foundation Displacement Forge is built on. The Z-Score gate ensures only statistically significant displacements qualify, filtering out small impulses caused by normal market noise.
Core Concepts
1. Z-Score Displacement Detection
Rather than using fixed ATR multiples to define a "significant" move, Displacement Forge computes the Z-Score of each bar's price change relative to the rolling distribution of recent price changes. The Z-Score measures how many standard deviations the current move is from the recent mean:
priceChg = close - close
avgChg = ta.sma(priceChg, zscoreLen)
stdChg = ta.stdev(priceChg, zscoreLen)
zscore = stdChg > 0 ? (priceChg - avgChg) / stdChg : 0.0
A positive Z-Score above the threshold with a bullish candle close and a higher close than recent highs — filtered by an EMA and VWAP trend context — constitutes a bullish displacement impulse. A negative Z-Score below the negative threshold with a bearish close and lower-than-recent lows in the opposing trend context constitutes a bearish displacement impulse.
2. Order Block Zone Identification
When a displacement impulse is detected, the indicator looks backward through the impulse lookback window for the last candle in the opposite direction — the candle just before the institutional move began. That candle's high and low define the order block zone. This captures the price range where institutional orders were being placed before the displacement candle consumed available liquidity:
if bullImpulse
for i = 1 to impulseLook
if close < open // Last bearish candle before the impulse
obLow := low
obHigh := high
break
Each zone is drawn as a box on the chart using the pre-impulse candle's range. Bull order blocks are drawn with a bullish tint (price expected to react bullishly when revisited). Bear order blocks with a bearish tint.
3. EMA and VWAP Trend Filter
Two independent trend filters gate displacement qualification. The EMA filter (200-period by default, configurable) requires bull displacements to occur above the EMA and bear displacements below it. The VWAP filter adds an intraday fair-value gate — bull displacements require price to be above the current VWAP, bear displacements require price to be below. Both filters can be independently enabled or disabled:
bullImpulse = zscore > threshold and close > open
and close > ta.highest(close, impulseLook)
and (not useEma or close > ema200)
and (not useVwap or close > ta.vwap)
4. Zone Reaction Detection and Rejection Counting
Active order block zones are continuously monitored for price reactions. A bullish reaction occurs when the candle low touches or enters the bull zone range with a bullish close. A bearish reaction occurs when the high touches or enters the bear zone range with a bearish close. Each confirmed reaction increments the independent bull and bear rejection counters displayed in the dashboard:
if ob.isBull and low <= ob.top and low >= ob.bottom and close > open
bullReactionDetected := true
totalBullRejections += 1
5. Zone Lifespan and Active Zone Management
Each zone carries an age counter that increments bar by bar. Zones exceeding the maximum age (configurable) are automatically removed as inactive. The active zone count and total tested zone count are tracked and displayed in the dashboard, giving a running picture of how many zones are currently relevant versus how many have been tested and absorbed.
Features
Z-Score impulse gate: Displacement qualification based on standard deviations from the rolling price-change distribution, not arbitrary fixed thresholds
Order block zone boxes: Pre-impulse candle ranges drawn as colored boxes on the chart for both bull and bear impulses
EMA trend filter: Configurable EMA length gates displacement direction relative to long-term trend
VWAP trend filter: Intraday VWAP provides a fair-value gate alongside the EMA for dual confirmation
Zone reaction monitoring: Active zones continuously checked for price reactions with independent bull and bear rejection counters
Zone age management: Configurable maximum zone age with automatic removal of expired zones
Active and tested zone counts: Dashboard tracks how many zones are live versus how many have been tested
Bull and bear rejection totals: Cumulative counts of all confirmed zone reactions by direction
Displacement markers: Labeled arrows at each confirmed displacement bar (BULL DISP, BEAR DISP) with size and style differentiation
Divergence detection: Z-Score divergence against price direction labeled (BULL DIV, BEAR DIV) and hidden divergence (H.BULL, H.BEAR)
Institutional dashboard (top right): 13-row table with Z-Score, displacement state, OB reactions, active zone count, tested zone count, EMA and VWAP filter status
Fully configurable: Z-Score length and threshold, impulse lookback, EMA length, VWAP toggle, zone max age, and zone visibility independently adjustable
Alerts: Separate alertconditions for bullish and bearish displacement impulses
Input Parameters
Displacement Detection:
Z-Score Length: Rolling window for mean and standard deviation calculation (default: 20)
Z-Score Threshold: Standard deviation threshold for displacement qualification (default: 1.5)
Impulse Lookback: Bars back to search for the pre-impulse order block candle (default: 5)
Trend Filters:
EMA Length: Trend EMA period (default: 200)
Use EMA Filter toggle (default: enabled)
Use VWAP Filter toggle (default: enabled)
Zone Management:
Max Zone Age (Bars): Maximum bar lifespan of active zones before automatic removal (default: 100)
Show OB Zones toggle
Display:
Show Dashboard toggle
Show Divergence Labels toggle
Bullish and Bearish color inputs
How to Use This Indicator
Step 1: Identify the Current Z-Score and Displacement State
The dashboard shows the live Z-Score value and displacement state (BULL IMPULSE, BEAR IMPULSE, or NEUTRAL). Use the Z-Score value as a real-time gauge of how statistically extreme the current price move is relative to recent history.
Step 2: Locate Active Order Block Zones
After any displacement, a colored box marks the pre-impulse candle range. These zones are the areas where institutional orders were accumulated before the move. The dashboard's Active Zones row shows how many live zones are currently on the chart.
Step 3: Wait for Price to Return to a Zone
When price retraces after a displacement and enters an active zone, watch for a reaction candle. A bullish close from within a bull zone or a bearish close from within a bear zone constitutes a zone reaction and increments the dashboard's rejection counter.
Step 4: Apply EMA and VWAP Context
The EMA filter status (ABOVE/BELOW) and VWAP filter status in the dashboard confirm whether the trend context supports the zone direction. An active bull zone with price above both the EMA and VWAP provides a higher-context long reaction than the same zone in a downtrend.
Step 5: Observe Divergence Labels
BULL DIV and BEAR DIV labels appear when the Z-Score diverges from price direction — Z-Score momentum and price momentum disagree. H.BULL and H.BEAR mark hidden divergence. These are secondary signals that may precede displacement reversals.
Indicator Limitations
The Z-Score is computed relative to the rolling price-change distribution of the configured lookback period. During regime changes or low-liquidity periods, the distribution can shift and cause the threshold to misfire
Order block identification looks backward from the displacement bar. The pre-impulse candle selection is algorithmic — it finds the last opposite-direction candle within the lookback. In some impulse structures this may not match the manually identified order block
Zone reaction detection requires the candle to touch the zone range in the same bar that a directional close occurs. Multi-bar zone entry sequences are not separately tracked
The VWAP calculation resets at daily boundaries. On instruments that trade across midnight or on continuous futures contracts, the VWAP reset behavior may differ from expectations
This indicator identifies order block zones and reactions. It does not generate trade entry signals, and zone reactions do not guarantee price continuation from the zone
Originality Statement
Displacement Forge is original in its application of Z-Score analysis to price change distribution as the gate for order block qualification, combined with a dual trend filter and automatic zone reaction monitoring with cumulative statistics. This indicator is published because:
Using the rolling Z-Score of bar-by-bar price changes — rather than raw ATR multiples — to define what constitutes a statistically significant displacement provides an adaptive, distribution-aware threshold that adjusts to current volatility rather than using fixed values
The pre-impulse candle lookback logic that identifies the order block as the last opposite-direction candle before the displacement provides a specific, repeatable rule for zone placement that eliminates the ambiguity of manual order block selection
The dual trend filter combining a configurable EMA with VWAP — both independently togglable — provides layered directional context that single-MA systems do not offer
Tracking cumulative bull and bear rejection counts alongside active and tested zone counts provides ongoing statistical feedback on how the order block zones are performing across the chart history
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Order block zones are identified using statistical and structural criteria but do not guarantee any particular price reaction when revisited. Z-Score thresholds are parameters that require adjustment to match specific instruments and timeframes. Past zone reactions do not guarantee future reactions. Always use proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Indicator

Indicator

Liquidity Contour Engine [JOAT]
Liquidity Contour Engine
Introduction
Liquidity Contour Engine is an overlay indicator that identifies two distinct institutional price phenomena: liquidity sweeps at swing highs and lows, and order blocks formed before impulsive structural moves. Liquidity sweep zones mark levels where price reached beyond a prior swing, triggering stop orders, then reversed — the classic footprint of a sweep-and-reversal sequence. Order block zones mark the last opposing candle before a significant directional impulse, representing the area where a large position was initiated.
The underlying premise is that institutions build and exit positions through order flow that leaves identifiable marks on the chart. A liquidity sweep is one such mark: price extending beyond a well-established swing level, clearing stops, then reversing. This behavior is not random — it reflects deliberate order accumulation at levels where retail stops cluster. Similarly, order blocks at the origin of impulsive moves may act as re-entry areas when price later returns to them.
Core Concepts
1. Confirmed Swing Pivot Detection
Swings are identified using ta.pivothigh and ta.pivotlow with a configurable lookback. All pivot detections are confirmed — offset by the lookback bars — meaning no repainting occurs. Only when sufficient bars have closed on both sides of a potential pivot is it registered.
2. Liquidity Sweep Detection
A bullish sweep is confirmed when: price wicks below the most recent swing low by at least a configurable ATR multiple, and the bar closes back above that swing low. This captures the wick-past-and-close-back pattern that characterizes institutional accumulation at liquidity levels. A bearish sweep is the mirror condition at swing highs.
Upon detection, a zone is created at the swept level, rendered as a dual-width line (thin solid + thick transparent shadow). Zones remain active until price sustains a close beyond the swept level by 0.5 ATR, at which point they convert to dotted lines (mitigated state).
3. Order Block Detection
An order block is identified as the prior N candle(s) before a structural impulse. A bullish impulse is defined as a bar that closes above the most recent swing high. The order block is the last candle body before that impulse, rendered as a filled box from body open to the wick high. Mitigation occurs when price closes beyond the 50% level of the order block body, fading the box to indicate the zone has been traded through.
4. Zone Lifecycle Management
The indicator uses arrays to track active zones and enforces a maximum count. When the maximum is exceeded, the oldest zone is removed from the chart. This prevents chart clutter while keeping the most recent and relevant zones visible.
Features
Liquidity Sweep Zones: Dual-width line rendering at swept swing levels, self-managing lifecycle
Order Block Boxes: Filled zones at order block origin, with mitigation fading
Swing Level Dotted Lines: Current swing high and low extensions as dotted reference lines
9-Row Dashboard: Sweep state, active zone counts, order block counts, last swing levels
Configurable ATR Threshold: Adjusts how far price must reach beyond a swing to qualify as a sweep
Max Zone Limit: Prevents chart clutter with configurable maximum active zone count
Input Parameters
Swing Lookback: Bars required each side for pivot confirmation (default: 8)
Sweep ATR Threshold: Minimum sweep distance in ATR units (default: 0.3)
Max Active Zones: Maximum concurrently displayed liquidity zones (default: 8)
ATR Period: Period for ATR calculation (default: 14)
Show Order Blocks: Toggle order block rendering
OB Lookback: How many bars back to identify the order block candle (default: 3)
How to Use This Indicator
Sweep-and-Reverse Setups
When a bullish sweep fires (price wicked below a swing low and closed back above), the zone represents the level where stops were taken. If price subsequently builds structure above that zone and delta pressure is positive, the setup is a potential long entry with the swept level as reference for the stop.
Order Block Re-Tests
When price returns to a bullish order block zone (shown in teal), it is revisiting the area where an institutional position was likely initiated. If the zone has not been mitigated (box remains filled), a reaction from that zone is plausible. A mitigated order block (faded) is a less reliable reference.
Zone Confluence
When a liquidity sweep zone and an order block coincide at the same price level, the confluence represents a stronger structural reference than either zone alone.
Limitations
Swing pivot confirmation introduces a bar lag equal to the lookback period. Sweeps and order blocks are identified after the fact, not in the moment they form
Not every liquidity sweep produces a reversal. Price can continue through a swept level without reversing
Order block identification is mechanical and cannot account for all institutional order placement strategies
On higher timeframes, zones cover wider price ranges and may require adjustment of the ATR threshold
Originality Statement
The unified framework for tracking liquidity sweeps and order blocks within a single indicator with a shared zone lifecycle management system is the original design contribution. Zone mitigation logic that converts active zones to passive reference lines (rather than deleting them) preserves structural context while visually indicating that a zone's primary relevance has passed. The dual-width shadow line rendering for sweep zones provides depth that distinguishes them clearly from standard horizontal lines.
Disclaimer
This indicator is for educational and informational purposes only. Liquidity sweep detection describes a pattern in historical price data. Past occurrences of this pattern do not guarantee future reactions. Order blocks are hypothetical areas of interest, not confirmed institutional levels. Always use proper risk management.
-Made with passion by officialjackofalltrades
Indicator

Institutional Zone Mapper [JOAT]Institutional Zone Mapper
Introduction
Institutional Zone Mapper is an open-source overlay indicator that detects swing-pivot order blocks — the last impulsive candle preceding a significant price displacement — and renders them as persistent box-based zones with session-color-coded borders, a four-component strength score from 0 to 10, touch-count tracking, and a configurable mitigation lifecycle. The indicator identifies the candle immediately before a confirmed swing pivot, verifies that a meaningful ATR-scaled displacement followed, and places a zone around that candle's midpoint. Zones are born with a strength score derived from displacement magnitude, session context, age, and zone height — allowing traders to instantly distinguish premium, high-conviction zones from weak, low-probability ones.
The core problem this indicator solves is that most order block tools place zones mechanically without quality filtering, flooding the chart with dozens of marginal levels that have little predictive value. The IZM's four-component scoring system ensures only zones with meaningful institutional characteristics survive on the chart. A minimum strength filter removes everything below the user-defined threshold, and the mitigation system automatically removes, stops extending, or fades zones that have been closed through — maintaining a clean, current map of active supply and demand.
Core Concepts
1. Swing Pivot Detection
The indicator uses ta.pivothigh and ta.pivotlow with a configurable swing length. A pivot high confirmed at bar_index means a price high existed swingLen bars ago that was higher than the swingLen bars on either side of it. When a pivot low is confirmed, the indicator looks back through a configurable candle lookback window to find the last bearish close candle before that pivot — this is the bullish order block candidate. The displacement check ensures the move from that candle to the pivot was at least ATR * dispMult, filtering out low-momentum pivots that are unlikely to represent genuine institutional accumulation.
2. Four-Component Strength Scoring
Each zone receives a score between 0 and 10 from four additive components:
Displacement Score (0-3): The ratio of the displacement to ATR is binned — larger moves score higher, capped at 3.0
Session Score (0-2): London and NY session zones score 2.0, Asia zones score 1.0, off-hours score 0.5
Age Score (0-2): Freshly formed zones (under 30 bars) score 2.0; zones over 150 bars old score 0.5
Zone Height Score (0-3): Zones whose ATR-normalized height falls in a sweet spot (0.5 to 2x ATR) score 3.0 — too tight or too wide zones score lower
The minimum strength filter (default 3.0/10) removes zones that fail to meet the threshold, keeping the chart uncluttered.
3. Session Classification and Color-Coded Borders
Each zone's birth session is stored and used to color its border: London zones receive a blue border (#60a5fa), NY zones a pink border (#f472b6), Asia zones a green border (#34d399), and off-hours zones a gray border (#64748b). The session is detected from the candle's timestamp using UTC hours, mapping to standard London (08:00-17:00 UTC), New York (13:00-22:00 UTC), and Asia (00:00-09:00 UTC) windows. This allows traders to immediately gauge which market session was active when institutional activity was registered.
4. Mitigation Lifecycle
When price closes through a zone — below the bottom of a bull OB, or above the top of a bear OB — the zone is considered mitigated. Three mitigation behaviors are available:
Delete: Zone is removed entirely from the chart
Stop Extending: Zone stops extending to the right and fades to near-transparent (zone box is fixed at the current bar)
Keep: Zone remains but fades visually to indicate mitigation
Touch counting is separate from mitigation — each confirmed close inside the zone increments the touch count, and the border progressively darkens with each retest to communicate how many times price has interacted with the level.
5. Proximity Detection
A configurable ATR buffer defines a proximity zone above each bull OB and below each bear OB. When price enters this buffer without yet entering the zone, the dashboard shows "NEAR" and proximity diamonds appear on the chart. This gives an early warning that price is approaching an active level before the actual retest occurs.
IZM showing the proximity diamond markers appearing as price approaches a bull OB from above, the info label updating with live age and touch count, and a faded zone after mitigation with the Stop Extending behavior active
Features
Swing Pivot Order Block Detection: Locates the last impulsive candle before a confirmed swing high or low with ATR-scaled displacement verification
Four-Component Strength Score (0-10): Displacement, session, age, and zone height combine into a single quality score — only zones above the minimum threshold are displayed
Session-Colored Borders: London blue / NY pink / Asia green / Off gray borders identify which session birthed each zone at a glance
Box-Based Zone Rendering: Solid box fills with session-colored borders — substantially more visible than linefill-based zone systems
Touch Count Darkening: Zone border opacity increases with each confirmed retest, visually communicating how frequently price has revisited the level
Three Mitigation Behaviors: Keep, Stop Extending, or Delete — each with optional fade-on-mitigation toggle
Proximity Markers and Dashboard State: Diamond markers and NEAR/ACTIVE dashboard state when price enters or approaches active zones
Info Labels: Dynamic text labels at zone right edge showing type, strength score, session, age in bars, zone height in pips/ticks, and touch count
Position Filter: Optional toggle to show only bull OBs below current price and bear OBs above, removing zones that are contextually irrelevant to the current price location
Max Active OBs: Oldest zones are trimmed when the array exceeds the configured maximum, keeping memory usage bounded
9-Row Dashboard: Active bull/bear OB counts, touch states (ACTIVE / NEAR), current session, ATR, minimum displacement distance, minimum strength threshold
6 Alertconditions: Zone entry, proximity approach, and new zone creation alerts for both bull and bear sides
Input Parameters
Order Block Detection:
Swing Length: Pivot confirmation lookback — higher values detect more significant, less frequent pivots (default 7)
OB Candle Lookback: How many bars back to search for the qualifying order block candle (default 20)
Displacement ATR Mult: Minimum displacement from OB candle to pivot, as a multiple of ATR (default 1.3)
Max Active OBs / Side: Maximum concurrent zones per direction before oldest are trimmed (default 5)
Min Strength Filter: Minimum strength score required to display a zone (default 3.0/10)
Zone Settings:
Zone ATR Width: Half the zone height expressed as ATR multiplier — sets the vertical thickness of zones (default 0.75)
Proximity Buffer (ATR): Distance above/below zone edge that activates the NEAR state (default 0.25)
Position Filter: When enabled, only shows zones on the correct side of current price (default off)
Mitigation:
On Mitigation: Keep / Stop Extending / Delete (default Stop Extending)
Fade On Mitigation: Whether to reduce zone opacity when mitigated (default on)
How to Use This Indicator
Primary Setup — Zone Retest Entry:
Look for price returning to an active zone (box fill area) after displacement away from it. When the dashboard shows ACTIVE and the zone has a high strength score (7+), this represents a high-quality retest opportunity. Enter in the zone's direction with a stop beyond the opposite edge of the box.
Reading the Strength Score:
Zones scoring 7-10 should be treated as premium levels — the displacement was large, the session was active, the zone is fresh, and the height is optimal. Zones scoring 3-5 are marginal. Use the minimum filter to remove low-quality zones entirely if the chart becomes cluttered.
Session Context:
London and NY zones (blue and pink borders) represent the most liquid, highest-participation session activity. An Asia-born zone that has not been retested by London or NY open is lower priority. A NY-born zone returning to price during the following London session is a high-context setup.
Proximity Workflow:
When a proximity diamond appears, price is approaching but has not entered a zone. This is the time to prepare your entry plan — set alerts using the Approaching alerts, watch for confirmation signals on a lower timeframe, and be ready when the NEAR state transitions to ACTIVE.
Indicator Limitations
Order block detection requires a confirmed swing pivot — pivot confirmation in Pine Script v6 is delayed by swingLen bars, meaning zones are created with a bar offset relative to the actual pivot price action
The displacement check uses the current-bar ATR, not the ATR at the time the zone was created — on rapidly expanding volatility environments this can temporarily raise the displacement threshold and filter out recent zones
The four-component scoring system uses static bin boundaries. Markets with unusually large or small ATR ranges may require tuning the displacement multiplier and zone width parameters to produce well-calibrated scores
Touch count increments on any confirmed close inside the zone, including the candle that originally created it. The first touch is therefore always the creation bar itself; meaningful retest context begins at touch count 2+
The mitigation logic detects a close through the zone edge, not an intrabar wick. Strong impulse candles that close back inside the zone will not trigger mitigation despite briefly penetrating the level
Originality Statement
This indicator is original in its four-component strength scoring system, session-colored border architecture, and touch-count border darkening feedback mechanism. The publication is justified because:
The four-component strength score (displacement, session, age, zone height) produces a quantitative quality ranking that is not present in standard order block tools, allowing the user to immediately identify premium versus marginal zones without manual evaluation
Session-colored borders encode institutional session context directly into the zone visual without requiring the user to maintain a separate session indicator, creating a self-contained contextual map
Touch-count border darkening provides a progressive visual feedback loop that communicates zone interaction history — the darker the border, the more times price has revisited the level
The proximity buffer and NEAR/ACTIVE dashboard state create a two-stage alert system that gives traders preparation time before an actual zone retest, reducing late entries
The mitigation lifecycle with fade-on-mitigation is a novel approach to zone management that preserves chart history while clearly delineating which zones remain actionable
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

AG Pro Order Block Reaction Quality [AGPro Series]AG Pro Order Block Reaction Quality
OVERVIEW / WHAT IT DOES
AG Pro Order Block Reaction Quality is an overlay tool designed to organize how price interacts with displacement-origin order block zones. The script identifies the last opposite candle before a strong impulsive move, projects that candle as a bullish or bearish order block, and then tracks whether price later respects, reacts to, or invalidates that zone.
The goal is not to treat every order block as equally important. Instead, the script focuses on reaction quality. When price revisits a tracked zone, the script evaluates the behavior around that revisit and converts the response into a structured quality score. This helps separate zones that produce cleaner reactions from zones that fail, weaken, or transition into breaker behavior.
The indicator is built as a chart-organization tool, not as a prediction engine. It is intended to help users study where impulsive moves originated, how later revisits behaved, and whether those revisits showed clean rejection, weak response, or invalidation. In that sense, the script is less about drawing boxes and more about mapping reaction structure around previously important displacement areas.
Because order block concepts are often displayed in a highly subjective way, this script uses deterministic conditions to reduce ambiguity. Impulse detection, order block selection, reaction-window scoring, and breaker conversion all follow rules-based logic. The objective is to make price interaction around those zones easier to inspect, compare, and review across different market conditions.
UNIQUE EDGE
Many order block tools focus mainly on detection. They draw a bullish or bearish block, then leave the interpretation to the user. This script adds an evaluation layer on top of that detection process. Rather than only asking where an order block exists, it also asks how convincingly price reacted when that zone was revisited.
That difference matters. Two zones may look similar at first glance, but the quality of the revisit can be very different. One revisit may reject cleanly and preserve the zone, while another may penetrate deeply, stall, or fully invalidate. By assigning reaction scores and grade-style labels, the script helps organize those differences visually.
The script also distinguishes active order blocks from breaker behavior. If a previously tracked zone is invalidated, the visualization shifts from standard order block context into breaker context. This adds structural continuity to the chart and helps users see when an old reaction area has lost its original character.
In practical use, the unique edge is the combination of three layers: impulsive-origin zone detection, revisit-based reaction scoring, and breaker-state continuity. Together, those layers aim to give traders a cleaner framework for studying order block behavior than a simple box-drawing approach.
METHODOLOGY
1) Impulse detection
The script first searches for strong directional candles whose range is large relative to ATR and whose move exceeds a recent breakout threshold. This is used as a rules-based approximation of displacement or impulsive participation.
2) Order block definition
Once an impulsive move is detected, the script searches backward for the last opposite candle inside a configurable lookback window. That candle becomes the source order block. Depending on settings, the zone can be projected using the full candle range or the candle body only.
3) Zone persistence and revisit tracking
After a zone is created, the script tracks whether price later trades back into it. That first interaction is important because it provides the data needed to evaluate how the revisit behaved.
4) Reaction quality scoring
When price revisits the zone, the script measures the behavior inside a reaction window. The score is based on factors such as entry precision into the zone, the magnitude of rejection away from the zone, structural integrity of the zone during the test, and the strength of the originating impulse. Those components are combined into a normalized score.
5) Grade translation
The raw score is then translated into a visual grade tier. This is meant to improve chart readability and allow faster comparison between zones that produced stronger versus weaker reactions.
6) Breaker conversion
If price invalidates a zone after it has been engaged, the script can treat that structure as a breaker block. This keeps prior structural context on the chart instead of simply removing it.
7) Visual organization
Bullish zones, bearish zones, and breaker structures are displayed with separate color families so users can distinguish standard order block context from post-invalidation context more quickly.
SIGNALS & ALERTS
The script includes alerts for newly detected bullish and bearish order blocks. These alerts are event-based and are intended to mark when a new candidate zone has been identified according to the script’s internal impulse and source-candle rules.
In addition, the visual state of the chart provides three broad categories of information:
- Active bullish or bearish order blocks that remain structurally valid.
- Breaker blocks that represent previously tracked zones after invalidation.
- Quality-scored reactions that help compare the strength of revisits.
These states should be interpreted as structural context, not as standalone trade instructions. A bullish order block on the chart does not guarantee a long setup, and a bearish order block does not guarantee a short setup. The script is designed to help users study reaction behavior around important zones, not to replace execution rules, risk management, or broader market context.
KEY INPUTS
ATR Length
Controls the volatility baseline used in impulse sizing and reaction calculations.
Impulse Size (x ATR)
Defines how large a move must be, relative to ATR, before it is treated as an impulsive displacement event.
OB Search Bars Back
Controls how far back the script looks for the last opposite candle that becomes the source order block.
Zone Mode
Lets the user choose whether zones are based on the full candle range or the candle body only.
Max Zones Tracked
Limits how many zones remain in memory and on the chart.
Zone Max Age (Bars)
Removes older zones after a defined number of bars so the chart does not grow indefinitely cluttered.
Reaction Window (Bars)
Defines the number of bars used to evaluate how price behaves after a zone is revisited.
Zone Extend (Bars)
Controls how far zones project into the future for chart visualization.
Show 50% Midline
Displays an internal midpoint inside the zone for users who want an additional internal reference.
Show Impulse Markers
Shows or hides impulse-origin markers on the chart.
Label Size
Controls the size of chart labels.
Panel Theme / Panel Font Size / Panel Position
These settings control the visual appearance and placement of the information panel.
LIMITATIONS & TRANSPARENCY
Order block analysis is inherently interpretive, and any script that formalizes it must impose strict rules. That means the script’s logic is intentionally selective. It will not match every discretionary order block definition used by every trader.
The script uses a specific rules-based approximation of impulse, source candle selection, revisit handling, and reaction scoring. As a result, some zones that a discretionary analyst might manually highlight will not appear, while some zones shown by the script may not align with every subjective framework.
Reaction quality is also dependent on the configured reaction window and the selected volatility context. Changing settings can change how aggressive or conservative the script becomes. For that reason, the indicator should be treated as a structured analytical model rather than an objective statement of market truth.
Breaker behavior shown by the script reflects the script’s invalidation logic only. It does not imply that a breaker block will necessarily act as support or resistance in the future. It simply preserves structural history after the original order block state is lost.
This indicator does not use volume profile, order flow, DOM data, or external market microstructure feeds. All calculations are derived from chart data available inside Pine Script.
RISK DISCLOSURE
This script is for chart analysis, research, and educational use. It does not provide financial advice, investment recommendations, or guaranteed outcomes.
No indicator can reliably predict future price movement on its own. Order block reactions may fail, clean-looking zones may break, and high scores do not ensure continuation or reversal. Market context, liquidity conditions, volatility regime, timeframe selection, and execution quality all matter.
Users should test settings carefully, apply independent judgment, and use appropriate risk management. This script should be treated as a decision-support tool for studying price interaction around displacement-origin zones, not as a standalone trading system.
Indicator

Institutional Smart Money Footprint (Volume Anomalies) by:EduardMost retail traders rely on moving averages and lagging oscillators, completely missing the fact that the market is governed by liquidity sweeps and algorithmic volume anomalies, I developed this stripped-down version of our institutional footprint tracker to map where the "Smart Money" is aggressively stepping in.
This engine doesn't just look at price action, it cross-validates extreme spread expansions with 150%+ volume surges to plot high-probability Demand and Supply blocks directly on your chart. When a whale moves, they leave a mathematical footprint. This algorithm highlights it.
If you are a discretionary trader, use these zones as hard exhaustion/reversal levels, if you are running a prop firm or need to translate complex logic like this into a fully automated, low-latency execution bot, my team specializes in custom algorithmic architecture (Pine Script, Python, and C#), feel free to study the open-source code or reach out directly for custom B2B engineering. Indicator

Indicator

Indicator

Confluence Order Blocks | ProjectSyndicateConfluence Order Blocks automatically identifies and validates high-probability, non-repainting Order Blocks. It filters for structural quality using displacement, normalizes all zone heights for consistency, and embeds a live multi-timeframe confluence engine inside every zone to provide a quantifiable, data-driven edge.
🧠 Live Multi-Timeframe Engine — This is not a single-timeframe tool. Every OB zone displayed on the chart is the result of a live, proximity-based confluence engine scanning three independent higher timeframes (e.g., M15, M30, H1) simultaneously. Each label shows exactly how many timeframes confirmed the zone, its composite strength rating (0-10), the session it formed in, its age, and its exact pip height, giving you an instant structural edge.
🎯 Displacement-Confirmed OBs — The engine doesn't just mark swing points. It validates each OB on the higher timeframes by requiring a powerful move away from the candle — a "displacement" — that is a user-defined multiple of the zone's range. This filters out weak or insignificant zones and focuses only on OBs that have demonstrated true market-moving intent before they are even considered for merging.
🎨 ATR-Normalized Zones — Eliminates visual noise from inconsistent zone sizes. This feature forces every merged OB zone to a uniform, ATR-based height (e.g., 0.75x ATR). This provides a clean, consistent chart and allows for a more objective analysis of price interaction with zones of equal visual weight, preventing massive tower blocks from distorting the chart.
📊 Proximity-Based Merging — Timeframes rarely align perfectly to the pip. The confluence engine uses an intelligent ATR-based proximity tolerance (e.g., 2.0x ATR) to detect when order blocks from different timeframes are clustered in the same price territory. It then mathematically merges them into a single, high-probability "Confluence Zone," ensuring you don't miss valid setups due to minor price discrepancies across timeframes.
✅ Chart-Timeframe Independent — The engine's credibility comes from its architectural stability. Unlike standard MTF indicators that repaint or shift zones depending on the chart you are viewing, this engine runs a completely stateless detection algorithm. The merged zones you see on an M1 chart are mathematically identical to the zones you see on an M5 or M15 chart.
🔧 Fully Customizable — Control every aspect of the engine, including the 3 target timeframes, the Minimum Timeframe Confluence threshold (e.g., require 3 out of 3 TFs), the Proximity Tolerance multiplier, the Minimum Strength Filter, and the colors/visibility of Bullish and Bearish zones.
🔬 Why this algo is unique: Standard Order Block indicators are subjective — often just drawing boxes on the current timeframe's last up/down candle before a swing, with no proof of higher-timeframe alignment. The Confluence OB Engine transforms this subjective tool into an objective, multi-dimensional trading instrument. It doesn't just show you a zone; it proves that the zone is backed by institutional intent across multiple timeframes, merging them into a single, undeniable area of interest on the exact chart you are viewing.
🌐 Apply to Gold (XAUUSD), Indices (US30, NAS100), Forex Majors, and Crypto on M1 or M5 execution timeframes while tracking M15, M30, and H1 structures. The engine is designed for assets that exhibit clear swing structures and respect deep supply/demand dynamics.
🗂️ How to use this? The most critical metric is the Timeframe Confluence Count and the Strength Rating. A zone confirmed by 3 timeframes with a Strength of 8.0+ indicates a massive structural edge. Consider only taking trades from these high-confluence zones that align with the prevailing higher-timeframe trend. The embedded label also shows the exact "pips away" distance, allowing for precise limit order placement.
⚙️ IMPORTANT NOTICE: This indicator is a professional-grade tool designed to identify structural confluence. It should NOT be used as a standalone signal for entering trades blindly. Always use it in conjunction with your own trading strategy, price action analysis, and strict risk management to confirm trade setups. Indicator

Fractal Velocity Accelerator [JOAT]Fractal Velocity Accelerator
Introduction
The Fractal Velocity Accelerator is an advanced open-source momentum indicator that combines fractal efficiency measurement, adaptive Laguerre filtering, and Gaussian smoothing to create a multi-dimensional momentum oscillator with institutional-grade signal generation. This indicator transforms raw price data into a sophisticated momentum measurement system that reveals not just momentum direction and strength, but also velocity, acceleration, and regime characteristics.
Unlike traditional momentum indicators that simply measure rate of change, this system analyzes the efficiency of price movement through fractal mathematics, applies adaptive lag reduction through Laguerre transforms, and smooths data using 4th-order Gauss filters. The result is a momentum oscillator that responds quickly to genuine momentum shifts while filtering out noise and false signals.
Why This Indicator Exists
This indicator addresses fundamental limitations in traditional momentum analysis by introducing fractal efficiency concepts and adaptive filtering:
4th-Order Gauss Filter: Ultra-smooth OHLC data processing that eliminates noise while preserving genuine price movements
Fractal Efficiency Engine: Logarithmic path efficiency measurement that quantifies how directly price moves from point A to point B
Adaptive Laguerre Transform: Dynamic lag reduction that adjusts based on fractal efficiency, responding faster during efficient moves
Percentile-Based Bands: Self-adjusting overbought/oversold zones that adapt to each instrument's unique momentum characteristics
Velocity and Acceleration Tracking: First and second derivative calculations that identify momentum shifts before they're obvious
Momentum Regime Classification: Seven-level regime system from Extreme Bearish to Extreme Bullish with confidence measurements
Divergence Detection: Fractal-based divergence scanner that identifies price-momentum asymmetries
Each component provides unique intelligence about momentum dynamics. Gauss filtering ensures clean data, fractal efficiency measures directional clarity, Laguerre adaptation reduces lag, percentile bands provide context, velocity/acceleration track changes, regime classification guides strategy, and divergences reveal hidden shifts.
Core Components Explained
1. 4th-Order Gauss Filter System
The indicator applies a sophisticated Gaussian filter to all OHLC data:
w = (2.0 * math.pi / gaussLength)
beta = (1 - math.cos(w)) / (math.pow(1.414, 2.0 / betaDev) - 1)
alpha = (-beta + math.sqrt(beta * beta + 2 * beta))
Gc := math.pow(alpha, 4) * close +
4 * (1.0 - alpha) * nz(Gc ) -
6 * math.pow(1 - alpha, 2) * nz(Gc ) +
4 * math.pow(1 - alpha, 3) * nz(Gc ) -
math.pow(1 - alpha, 4) * nz(Gc )
This 4th-order filter provides exceptional smoothing while maintaining responsiveness. The filter uses four previous values with specific weightings that create a bell curve response, eliminating high-frequency noise while preserving genuine price movements.
The beta deviation parameter (default 2.0) controls filter aggressiveness. Higher values create more smoothing but add lag. Lower values maintain responsiveness but allow more noise. The default balances these tradeoffs optimally for most instruments.
2. Fractal Efficiency Calculation
Fractal efficiency measures how efficiently price moves by comparing net displacement to total path length:
sumRange = math.sum((math.max(Gh, nz(Gc )) - math.min(Gl, nz(Gc ))), fractalLength)
totalRange = ta.highest(Gh, fractalLength) - ta.lowest(Gl, fractalLength)
fractalGamma = if totalRange > 0
math.log(sumRange / totalRange) / math.log(fractalLength)
else
0.0
fractalEfficiency = math.max(0, math.min(1, (fractalGamma + 1) / 2))
The calculation uses logarithmic scaling to measure path complexity. When price moves in a straight line (high efficiency), the ratio approaches 1.0. When price moves erratically (low efficiency), the ratio approaches 0.0.
Fractal efficiency is normalized to 0-1 range where:
- 1.0 = Perfect efficiency (straight line movement)
- 0.7-1.0 = High efficiency (strong trending)
- 0.4-0.7 = Moderate efficiency (developing trend)
- 0.0-0.4 = Low efficiency (choppy/ranging)
This measurement is crucial because it determines how aggressively the Laguerre filter adapts.
3. Adaptive Laguerre Transform
The Laguerre filter applies adaptive lag reduction based on fractal efficiency:
gamma = laguerreGamma * (1 - fractalEfficiency) + 0.1 * fractalEfficiency
L0 := (1 - gamma) * Gc + gamma * nz(L0 )
L1 := -gamma * L0 + nz(L0 ) + gamma * nz(L1 )
L2 := -gamma * L1 + nz(L1 ) + gamma * nz(L2 )
L3 := -gamma * L2 + nz(L2 ) + gamma * nz(L3 )
cu = (L0 > L1 ? L0 - L1 : 0) + (L1 > L2 ? L1 - L2 : 0) + (L2 > L3 ? L2 - L3 : 0)
cd = (L0 < L1 ? L1 - L0 : 0) + (L1 < L2 ? L2 - L1 : 0) + (L2 < L3 ? L3 - L2 : 0)
laguerreRSI = cu + cd != 0 ? 100 * (cu / (cu + cd)) : 50
The Laguerre transform creates four cascading filters (L0-L3) that progressively smooth the data. The gamma parameter controls lag - lower gamma means less lag but more noise, higher gamma means more lag but smoother output.
The adaptive component adjusts gamma based on fractal efficiency:
- High efficiency (trending): Gamma decreases toward 0.1, reducing lag for fast response
- Low efficiency (choppy): Gamma increases toward laguerreGamma setting, adding smoothing to filter noise
The cu (count up) and cd (count down) calculations measure upward vs downward movement across the four Laguerre levels, creating an RSI-like oscillator that's far more responsive than traditional RSI.
4. Fractal Momentum Oscillator
The final momentum value combines Laguerre RSI with fractal efficiency:
rawMomentum = (laguerreRSI - 50) * (1 + fractalEfficiency)
momentumEMA = ta.ema(rawMomentum, 5)
fractalMomentum = math.max(-100, math.min(100, momentumEMA))
This calculation:
1. Centers Laguerre RSI around zero by subtracting 50
2. Amplifies the signal by (1 + fractalEfficiency), giving more weight to efficient moves
3. Smooths with 5-period EMA to reduce jitter
4. Bounds the result to -100 to +100 range
The efficiency amplification is key - during high-efficiency trending moves, momentum readings become more extreme, providing clear signals. During low-efficiency choppy moves, momentum readings stay muted, preventing false signals.
5. Velocity and Acceleration Tracking
The indicator calculates first and second derivatives of momentum:
momentumVelocity = ta.change(fractalMomentum, 1)
momentumAcceleration = ta.change(momentumVelocity, 1)
velocityEMA = ta.ema(momentumVelocity, 3)
Velocity (first derivative) shows the rate of momentum change. Positive velocity means momentum is increasing, negative velocity means momentum is decreasing.
Acceleration (second derivative) shows the rate of velocity change. Positive acceleration means velocity is increasing (momentum gaining speed). Negative acceleration means velocity is decreasing (momentum losing speed).
These metrics provide early warning of momentum shifts:
- Positive momentum + positive velocity + positive acceleration = Strong bullish momentum building
- Positive momentum + positive velocity + negative acceleration = Bullish momentum slowing (potential top)
- Positive momentum + negative velocity = Bullish momentum fading (reversal warning)
6. Momentum Regime Classification
The indicator classifies momentum into seven regimes:
Extreme Bullish: Momentum > threshold (default 60), very strong upward pressure
Strong Bullish: Momentum 40-60, solid upward pressure
Weak Bullish: Momentum 20-40, mild upward pressure
Neutral: Momentum -20 to +20, balanced conditions
Weak Bearish: Momentum -40 to -20, mild downward pressure
Strong Bearish: Momentum -60 to -40, solid downward pressure
Extreme Bearish: Momentum < -threshold, very strong downward pressure
Each regime includes confidence measurement equal to the absolute momentum value. Higher confidence indicates stronger regime conviction.
7. Adaptive Band System
The indicator uses percentile-based bands that adapt to each instrument:
momentumPercentile = ta.percentrank(fractalMomentum, bandLength)
dynamicOB = ta.percentile_linear_interpolation(fractalMomentum, bandLength, obLevel)
dynamicOS = ta.percentile_linear_interpolation(fractalMomentum, bandLength, 100 - obLevel)
These bands automatically adjust to the instrument's typical momentum range. An instrument that frequently reaches ±80 will have wider bands than one that typically stays within ±40. This prevents false overbought/oversold signals on volatile instruments and ensures sensitivity on stable instruments.
8. Fractal Divergence Detection
The indicator detects divergences using fractal pivot analysis:
momentumHigh = ta.pivothigh(fractalMomentum, divLookback, divLookback)
momentumLow = ta.pivotlow(fractalMomentum, divLookback, divLookback)
bullishDiv := lastPrice < prevPrice and lastMomentum > prevMomentum and lastMomentum < 0
bearishDiv := lastPrice > prevPrice and lastMomentum < prevMomentum and lastMomentum > 0
Regular divergences signal potential reversals:
- Bullish: Price makes lower low, momentum makes higher low (selling pressure weakening)
- Bearish: Price makes higher high, momentum makes lower high (buying pressure weakening)
Hidden divergences signal trend continuation:
- Hidden Bullish: Price makes higher low, momentum makes lower low (trend resumption after pullback)
- Hidden Bearish: Price makes lower high, momentum makes higher high (downtrend resumption after bounce)
Visual Elements
Multi-Layer Momentum Line: Three overlaid plots (white underlay, gradient middle, solid core) creating depth and visibility
Velocity Histogram: Histogram showing momentum velocity scaled 10x for visibility
Adaptive Bands: Dynamic overbought/oversold lines that adjust to instrument characteristics
Zone Fills: Gradient fills between bands and zero line showing bullish/bearish zones
Reference Lines: Horizontal lines at extreme (±60), strong (±40), and weak (±20) levels
Regime Background: Subtle background coloring showing current momentum regime
Divergence Labels: Text labels marking regular and hidden divergences
Reversal Signals: Labels marking extreme momentum reversals
Velocity Signals: Small labels marking velocity acceleration/deceleration
Comprehensive Dashboard: 14-row intelligence panel showing momentum value, regime, velocity, acceleration, efficiency, Laguerre RSI, trend strength, consistency, adaptive bands, and divergence status
The dashboard provides complete momentum intelligence with color-coded metrics and status indicators.
Input Parameters
Signal Architecture:
Extreme Momentum Reversals: Toggle high-confidence exhaustion signals (default enabled)
Fractal Divergence Detection: Toggle price-momentum asymmetry detection (default enabled)
Velocity Acceleration Alerts: Toggle momentum acceleration warnings (default enabled)
Extreme Momentum Threshold: Score required for extreme classification (40-90, default 60)
Gauss Filter:
Gauss Filter Length: Smoothing period (5-100, default 20)
Beta Deviation: Filter aggressiveness (0.5-5.0, default 2.0)
Fractal Engine:
Fractal Efficiency Length: Efficiency calculation period (10-200, default 50)
Laguerre Transform:
Laguerre Gamma: Base lag parameter (0.1-0.99, default 0.7)
Adaptive Bands:
Band Percentile Length: Percentile calculation period (20-500, default 100)
Overbought Level: Upper band percentile (50-95, default 75)
Oversold Level: Lower band percentile (5-50, default 25)
Divergence:
Enable Divergence Scanner: Toggle divergence detection (default enabled)
Divergence Lookback: Pivot detection period (3-20, default 5)
Visualization:
Momentum Intelligence Panel: Toggle dashboard (default enabled)
Momentum Regime Zones: Toggle background coloring (default enabled)
Velocity Histogram: Toggle velocity display (default enabled)
Dashboard Scale: Small/Normal/Large sizing (default Normal)
Colors:
All colors fully customizable including bullish momentum (neon cyan), bearish momentum (neon pink), extreme bullish (neon green), extreme bearish (neon red), neutral (gold), and divergence (neon purple).
How to Use This Indicator
Step 1: Assess Momentum Value and Direction
Check dashboard "MOMENTUM" value and direction. Positive values indicate bullish momentum, negative indicate bearish. Values above 60 or below -60 suggest extreme conditions that may precede reversals or strong continuations.
Step 2: Identify Current Regime
Review "REGIME" classification and confidence percentage. Extreme regimes with high confidence (>80%) indicate strong momentum that typically continues. Weak regimes suggest transitional conditions.
Step 3: Monitor Velocity and Acceleration
Check "VELOCITY" and "ACCEL" metrics. Positive velocity with positive acceleration suggests momentum is building. Negative acceleration while momentum is still positive warns of potential momentum exhaustion.
Step 4: Evaluate Fractal Efficiency
Review "EFFICIENCY" percentage. High efficiency (>70%) confirms that momentum is backed by clean, directional price movement. Low efficiency (<40%) suggests choppy conditions where momentum signals may be less reliable.
Step 5: Check Adaptive Bands
Monitor "OB LEVEL" and "OS LEVEL" showing dynamic overbought/oversold thresholds. When momentum exceeds these levels, watch for reversal signals or continuation acceleration.
Step 6: Watch for Divergences
Check "DIVERGENCE" status and look for divergence labels. Regular divergences at extreme momentum levels often precede significant reversals. Hidden divergences in established trends suggest continuation after pullbacks.
Step 7: Identify Extreme Reversals
Watch for "EXTREME REVERSAL" labels when momentum crosses from extreme territory. These high-confidence signals often mark major turning points or trend acceleration phases.
Step 8: Track Velocity Acceleration
Monitor velocity acceleration labels. "VELOCITY ACCEL" signals indicate momentum is gaining speed, often marking optimal entry timing in early trend phases.
Best Practices
Extreme momentum reversals (>60 or <-60) are most reliable when confirmed by velocity deceleration
High fractal efficiency (>70%) validates momentum signals as backed by clean price action
Divergences at extreme momentum levels offer highest-probability reversal setups
Velocity acceleration signals work best in early trend phases, less reliable in mature trends
Adaptive bands automatically adjust to instrument volatility - respect them as dynamic thresholds
Momentum regime transitions provide clear strategy adjustment points
Combine momentum analysis with price action for optimal entry timing
Laguerre RSI above 70 or below 30 confirms extreme momentum readings
Trend strength above 60 indicates strong momentum persistence
Trend consistency above 70 confirms momentum is directionally stable
Hidden divergences in strong trends (momentum >40 or <-40) suggest continuation opportunities
Neutral regime (-20 to +20) suggests range-bound conditions unsuitable for momentum strategies
Indicator Limitations
Momentum indicators are lagging by nature - they confirm trends rather than predict them
Extreme momentum can persist longer than expected during strong trends
Fractal efficiency requires sufficient price history - may be unreliable on newly listed instruments
Gauss filter adds smoothing which inherently introduces some lag
Adaptive bands require adequate history for percentile calculations
Divergences can persist for extended periods before price responds
The indicator works best on liquid instruments with consistent price action
Very low timeframes may produce excessive noise despite filtering
Velocity and acceleration are sensitive to sudden price spikes
Regime classification is probabilistic, not deterministic
The indicator shows momentum dynamics but cannot predict duration
Technical Implementation
Built with Pine Script v6 using:
4th-order Gaussian filter with customizable beta deviation
Logarithmic fractal efficiency calculation using path complexity measurement
Adaptive Laguerre transform with four cascading filter levels
Fractal momentum oscillator combining Laguerre RSI with efficiency amplification
First and second derivative calculations for velocity and acceleration
Seven-level momentum regime classification with confidence measurement
Percentile-based adaptive bands using linear interpolation
Fractal pivot-based divergence detection system
Multi-layer gradient visualization with depth effects
Comprehensive dashboard with 14 metrics and color-coded indicators
Alert system for reversals, divergences, and velocity signals
The code is fully open-source with extensive comments explaining fractal mathematics and adaptive filtering concepts.
Originality Statement
This indicator is original in its integration of fractal efficiency with adaptive momentum measurement. While individual components exist, this indicator is justified because:
It combines 4th-order Gauss filtering with fractal efficiency and Laguerre transforms in a unified system
The adaptive Laguerre gamma adjustment based on fractal efficiency is a novel approach to lag reduction
Fractal momentum amplification using efficiency multiplier creates regime-aware momentum measurement
Velocity and acceleration tracking provides multi-dimensional momentum analysis
Seven-level regime classification with confidence measurement guides strategy selection
Percentile-based adaptive bands automatically adjust to each instrument's characteristics
Fractal pivot-based divergence detection identifies asymmetries with statistical precision
The comprehensive dashboard synthesizes 14 distinct metrics into unified momentum intelligence
Multi-layer visualization with gradient effects provides exceptional clarity
Integration of efficiency, velocity, acceleration, and regime creates layered confirmation
Each component contributes unique intelligence: Gauss filtering ensures clean data, fractal efficiency measures directional quality, Laguerre adaptation reduces lag, momentum oscillator quantifies strength, velocity tracks changes, acceleration identifies inflections, regime classification guides strategy, bands provide context, and divergences reveal hidden shifts. The indicator's value lies in combining these complementary perspectives into a cohesive, adaptive momentum system.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Momentum analysis is a tool for understanding price dynamics, not a crystal ball for predicting future movement. Extreme momentum readings do not guarantee reversals. Divergences do not guarantee price response. Past momentum patterns do not guarantee future patterns. Market conditions change, and strategies that worked historically may not work in the future.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. Momentum readings, divergences, and regime classifications do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Full Indicador v3.0 - By Claudio HerreraThis script combines several custom indicators to create a configuration that adapts to all timeframes.
The Domenec Tunnel, with its custom, modified moving averages, allows us to always know where we stand. The moving averages and correction tapes, calibrated to fit any chart, provide a visual advantage during analysis, enabling us to quickly recognize trends and critical areas.
The color-coded indicator adds extra value by highlighting "strength/weakness/doubt" in the movement or direction, as well as indicating whether an impulse is strong enough to sustain over time. It allows us to quickly recognize trend exhaustion and reversals.
The inclusion of ICT indicators, support and resistance levels, trend lines, market structure, and FVG detection allows us to identify areas of interest with high volume where the price consistently returns. Indicator

ICT Order Block ProOverview
The ICT Order Block Pro is a comprehensive, quantitative trading system designed to mechanically identify high-probability Order Blocks (OBs) based on strict Inner Circle Trader (ICT) concepts.
Unlike standard indicators that simply highlight large candles, this script acts as a "Narrative Engine." It demands that specific market conditions—such as liquidity sweeps, structural shifts, and session timing—are met before an Order Block is validated. Furthermore, it dynamically projects the Draw on Liquidity (DOL) to provide mechanical Take Profit targets.
Core Concepts & Educational Logic
For an Order Block to be considered high-probability in the ICT methodology, it must be the origin of a significant change in the state of delivery. This script validates setups based on the following sequence:
The Purge (Liquidity Sweep): The swing that forms the OB must first sweep a short-term liquidity pool (prior highs/lows). If an OB forms in the middle of a range without taking liquidity, it is ignored.
The Shift (MSS): The displacement away from the OB must aggressively break a recent structural pivot, confirming institutional sponsorship.
The Imbalance: The displacement must leave behind a Fair Value Gap (FVG).
PD Array Alignment: The script dynamically calculates the current dealing range (or utilizes HTF ranges) to ensure bullish setups only trigger in a Discount, and bearish setups only trigger in a Premium.
Key Features
1-2-3 Draw on Liquidity (DOL) Targeting: The script runs a background algorithm to map unmitigated Buy-Side (BSL) and Sell-Side (SSL) liquidity pools. When a valid OB forms, a dashed target line automatically projects toward the closest opposing liquidity pool.
Breaker Block Conversion: Order blocks are not simply deleted when mitigated. If price closes through an OB's Mean Threshold (50% mark), the script dynamically flips its polarity, converting it into a Breaker Block (+BRK / -BRK) for secondary entries.
Higher Timeframe (HTF) Nesting: The indicator continuously monitors your chosen HTF. If a Current Timeframe (CT) Order Block forms inside an active HTF Order Block of the same direction, it is marked with a star (★) to denote high confluence.
Algorithmic Macros & Kill Zones: Built-in session filters allow you to restrict OB detection strictly to the NY AM/PM Kill Zones or specific "Silver Bullet" algorithmic macro windows (e.g., 09:50–10:10 AM EST).
Strict Mean Threshold Invalidation: Instead of waiting for a full candle close outside the OB, the script invalidates or converts the block the moment a candle body closes past the 50% Mean Threshold.
How to Use This Indicator
Wait for the Setup: Look for a highlighted OB to appear during your active session.
Confirm the Target: Note the dashed Draw on Liquidity line projecting from the OB. This is your mechanical target.
Execution: Enter when price taps the OB box. Place your stop loss just outside the box (or at the Mean Threshold if using strict validation).
Breaker Scenarios: If your primary OB fails and converts into a Breaker Block, monitor for a return to the Breaker for a continuation trade in the opposite direction.
Customization (Engine Tuning)
Every market is fractal, and volatility differs across assets. You can fully tune the engine in the settings:
Adjust the lookback lengths for the Liquidity Sweeps and Market Structure Shifts (e.g., increase lengths for 1m scalping, decrease for 1H swing trading).
Toggle between Dynamic Fractal Dealing Ranges or static HTF ranges for Premium/Discount filtering.
Customize all visual elements, including Breaker colors, target lines, and macro background highlights.
Disclaimer: This script is designed for educational and analytical purposes only. It does not constitute financial advice. Always backtest mechanical systems thoroughly on your specific asset and timeframe before live trading. Indicator
