OPEN-SOURCE SCRIPT
Advanced Market Structure [OmegaTools]

📌 Market Structure [OmegaTools]
Advanced Market Structure is a next–generation indicator designed to decode price structure in real time by combining classical swing–based analysis with modern quantitative confirmation techniques. Built for traders who demand both precision and adaptability, it provides a robust multi–layered framework to identify structural shifts, trend continuations, and potential reversals across any asset class or timeframe.
Unlike traditional structure indicators that rely solely on visual swing identification, Market Structure [OmegaTools] introduces an integrated methodology: pivot detection, Donchian trend modeling, statistical confirmation via Z–Score, and volume–based validation. Each element contributes to a comprehensive, systematic representation of the underlying market dynamics.
🔑 Core Features
1. Five Distinct Market Structure Modes
Standard Mode:
Captures structural breaks through classical swing high/low pivots. Ideal for discretionary traders looking for clarity in directional bias.
Confirmed Breakout Mode:
Requires validation beyond the initial pivot break, filtering out noise and reducing false positives.
Donchian Trend HL (High/Low):
Establishes structure based on absolute highs and lows over rolling lookback windows. This approach highlights broader momentum shifts and trend–defining extremes.
Donchian Trend CC (Close/Close):
Similar to HL mode, but calculated using closing prices, enabling more precise bias identification where close–to–close structure carries stronger statistical weight.
Average Mode:
A composite methodology that synthesizes the four models into a weighted signal, producing a balanced structural bias designed to minimize model–specific weaknesses.
2. Dynamic Pivot Recognition with Auto–Updating Levels
Swing highs and lows are automatically detected and plotted with adaptive horizontal levels. These dynamic support/resistance markers continuously extend into the future, ensuring that historically significant levels remain visible and actionable.
3. Color–Adaptive Candlesticks
Price bars are dynamically recolored to reflect the prevailing structural regime: bullish (default blue), bearish (default red), or neutral (gray). This enables instant visual recognition of regime changes without requiring external confirmation.
4. Statistical Reversal Triggers
The script integrates a 21–period Z–Score calculation applied to closing prices, combined with multi–layered volume confirmation (SMA and EMA convergence).
Bullish trigger: Z–Score < –2 with structural confirmation and volume support.
Bearish trigger: Z–Score > +2 with structural confirmation and volume support.
Signals are plotted as diamond markers above or below the bars, identifying potential high–probability reversal setups in real time.
5. Integrated Alpha Backtesting Engine
Each market structure mode is evaluated through a built–in backtesting routine, tracking hit ratios and consistency across the most recent ~2000 structural events.
Performance metrics (“Alpha”) are displayed directly on–chart via a dedicated Performance Dashboard Table, allowing side–by–side comparison of Standard, Confirmed Breakout, Donchian HL, Donchian CC, and Average models.
Traders can instantly evaluate which structural methodology best adapts to the current market conditions.
🎯 Practical Advantages
Systematic Clarity: Eliminates subjectivity in defining structural bias, offering a rules–based framework.
Statistical Transparency: Built–in performance metrics validate each mode in real time, allowing informed decision–making.
Noise Reduction: Confirmed Breakouts and Donchian modes filter out common traps in structural trading.
Multi–Asset Adaptability: Optimized for scalping, intraday, swing, and multi–day strategies across FX, equities, futures, commodities, and crypto.
Complementary Usage: Works as a stand–alone structure identifier or as a quantitative filter in larger algorithmic/trading frameworks.
⚙️ Ideal Users
Discretionary traders seeking an objective reference for structural bias.
Quantitative/systematic traders requiring on–chart statistical validation of structural regimes.
Technical analysts leveraging pivots, Donchian channels, and price action as part of broader frameworks.
Portfolio traders integrating structure into multi–factor models.
💡 Why This Tool?
Market Structure [OmegaTools] is not a static indicator — it is an adaptive framework. By merging classical pivot theory with Donchian–style momentum analysis, and reinforcing both with statistical backtesting and volume confirmation, it provides traders with a unique ability:
To see the structure,
To measure its reliability,
And to act with confidence on quantifiably validated signals.
Advanced Market Structure is a next–generation indicator designed to decode price structure in real time by combining classical swing–based analysis with modern quantitative confirmation techniques. Built for traders who demand both precision and adaptability, it provides a robust multi–layered framework to identify structural shifts, trend continuations, and potential reversals across any asset class or timeframe.
Unlike traditional structure indicators that rely solely on visual swing identification, Market Structure [OmegaTools] introduces an integrated methodology: pivot detection, Donchian trend modeling, statistical confirmation via Z–Score, and volume–based validation. Each element contributes to a comprehensive, systematic representation of the underlying market dynamics.
🔑 Core Features
1. Five Distinct Market Structure Modes
Standard Mode:
Captures structural breaks through classical swing high/low pivots. Ideal for discretionary traders looking for clarity in directional bias.
Confirmed Breakout Mode:
Requires validation beyond the initial pivot break, filtering out noise and reducing false positives.
Donchian Trend HL (High/Low):
Establishes structure based on absolute highs and lows over rolling lookback windows. This approach highlights broader momentum shifts and trend–defining extremes.
Donchian Trend CC (Close/Close):
Similar to HL mode, but calculated using closing prices, enabling more precise bias identification where close–to–close structure carries stronger statistical weight.
Average Mode:
A composite methodology that synthesizes the four models into a weighted signal, producing a balanced structural bias designed to minimize model–specific weaknesses.
2. Dynamic Pivot Recognition with Auto–Updating Levels
Swing highs and lows are automatically detected and plotted with adaptive horizontal levels. These dynamic support/resistance markers continuously extend into the future, ensuring that historically significant levels remain visible and actionable.
3. Color–Adaptive Candlesticks
Price bars are dynamically recolored to reflect the prevailing structural regime: bullish (default blue), bearish (default red), or neutral (gray). This enables instant visual recognition of regime changes without requiring external confirmation.
4. Statistical Reversal Triggers
The script integrates a 21–period Z–Score calculation applied to closing prices, combined with multi–layered volume confirmation (SMA and EMA convergence).
Bullish trigger: Z–Score < –2 with structural confirmation and volume support.
Bearish trigger: Z–Score > +2 with structural confirmation and volume support.
Signals are plotted as diamond markers above or below the bars, identifying potential high–probability reversal setups in real time.
5. Integrated Alpha Backtesting Engine
Each market structure mode is evaluated through a built–in backtesting routine, tracking hit ratios and consistency across the most recent ~2000 structural events.
Performance metrics (“Alpha”) are displayed directly on–chart via a dedicated Performance Dashboard Table, allowing side–by–side comparison of Standard, Confirmed Breakout, Donchian HL, Donchian CC, and Average models.
Traders can instantly evaluate which structural methodology best adapts to the current market conditions.
🎯 Practical Advantages
Systematic Clarity: Eliminates subjectivity in defining structural bias, offering a rules–based framework.
Statistical Transparency: Built–in performance metrics validate each mode in real time, allowing informed decision–making.
Noise Reduction: Confirmed Breakouts and Donchian modes filter out common traps in structural trading.
Multi–Asset Adaptability: Optimized for scalping, intraday, swing, and multi–day strategies across FX, equities, futures, commodities, and crypto.
Complementary Usage: Works as a stand–alone structure identifier or as a quantitative filter in larger algorithmic/trading frameworks.
⚙️ Ideal Users
Discretionary traders seeking an objective reference for structural bias.
Quantitative/systematic traders requiring on–chart statistical validation of structural regimes.
Technical analysts leveraging pivots, Donchian channels, and price action as part of broader frameworks.
Portfolio traders integrating structure into multi–factor models.
💡 Why This Tool?
Market Structure [OmegaTools] is not a static indicator — it is an adaptive framework. By merging classical pivot theory with Donchian–style momentum analysis, and reinforcing both with statistical backtesting and volume confirmation, it provides traders with a unique ability:
To see the structure,
To measure its reliability,
And to act with confidence on quantifiably validated signals.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.