OPEN-SOURCE SCRIPT
Aggiornato Absolute ZigZag

This ZigZag Indicator is a bit unique in it's kind.
It uses my own Absolute ZigZag Lib to calculate the pivots:
Instead of using percentages or looking more than 1 bar left or right, this Zigzag library calculates pivots by just looking at the current bar highs and lows and the ones of one bar earlier. This is a very fast and accurate way of calculating pivots.
The library also features a solution for bars that have both a higher high and a higher low like seen below.

You can also use your own colors for the labels and the lines:

You can also quickly select a one-colored theme without changing all colors at once:

It uses my own Absolute ZigZag Lib to calculate the pivots:
Instead of using percentages or looking more than 1 bar left or right, this Zigzag library calculates pivots by just looking at the current bar highs and lows and the ones of one bar earlier. This is a very fast and accurate way of calculating pivots.
The library also features a solution for bars that have both a higher high and a higher low like seen below.
You can also use your own colors for the labels and the lines:
You can also quickly select a one-colored theme without changing all colors at once:
Note di rilascio
This ZigZag Indicator is a bit unique in it's kind.It uses my own Absolute ZigZag Lib to calculate the pivots:
Instead of using percentages or looking more than 1 bar left or right, this Zigzag indicator calculates pivots by just looking at the current bar highs and lows and the ones of one bar earlier. This is a very fast and accurate way of calculating pivots.
The indicator also features a solution for bars that have both a higher high and a higher. In this situation the indicator will look into a lower time-frame to detect what event happened first. You can turn this feature off in the settings.
Note di rilascio
Added support for custom amount of pivots to be shown on the chartNote di rilascio
Update: Pivot Limit setting now under General section in settings screenNote di rilascio
Update: Fixed error on 1 minute charts for users that have lower tiers or free subscription plans.Users with subscription plans that support second charts can now mark a checkbox in the settings that allows the script to process seconds charts for accurate in-candle lookup.
Note di rilascio
Major Update: Market Structure & Logic ImprovementsThis update introduces powerful new features to filter price noise and adds logic to handle specific candle formations, alongside several critical bug fixes.
New Features
- Ignore Inside Bars: Added a new feature to filter out inside bars. When enabled, the script ignores price action inside the previous candle, comparing breakouts against the last valid structural candle. Enabled by default!
- Outside Bar Handling: Introduced a new priority setting for Outside (Engulfing) candles. You can now determine the ZigZag direction based on Auto (Lower Timeframe), Sentiment (Candle Color), or fixed High/Low priority. Auto will fall back to sentiment setting if no lower timeframe data was available.
- UI Improvements: Added helpful tooltips to the settings menu to explain the various features.
Bugfixes & Improvements
- Label Logic: Fixed a bug where "Lower Highs" (LH) and "Lower Lows" (LL) were sometimes mislabeled as generic Highs/Lows.
- Tooltip Logic: Corrected an inversion error in the tooltips for Pivot Lows.
- Double Tops/Bottoms: The indicator now correctly updates the label to the most recent bar if the price is exactly equal to the previous pivot.
- Stability: Fixed a calculation issue that could occur on the very first bar of the chart history.
Note di rilascio
UI & Settings Organization UpdateThis update focuses on cleaning up the settings menu to make the indicator easier to configure.
Changes
- Label Visibility Group: I have reorganized the show/hide toggles for labels (HH, HL, LL, LH, etc.). They are now grouped into compact rows under a dedicated "Label Visibility" section, reducing clutter in the settings menu.
- Coloring Strategy: Renamed the "Style" setting to "Coloring Strategy" to make the options more intuitive:
- Trend: Colors both lines and labels based on market structure.
- Trend (Labels Only): Colors only the labels, keeping lines standard.
- Mono (Default): Uses a single default color for a minimalist look.
- Trend: Colors both lines and labels based on market structure.
Note di rilascio
Ignoring Inside Bars is now disabled by default.(because it can cause charts stop drawing new zigzag line for a long time after a black/white swan event with extremely large candles).
Note di rilascio
Smart Noise Filtering & Logic UpdateThis update brings significant improvements to market structure detection by filtering noise without sacrificing reactivity during high volatility.
New Features
- Smart Inside Bar Filter (ATR Anomaly): We have re-enabled the "Ignore Inside Bars" feature by default because it is now smarter. It uses an ATR Anomaly Filter to detect massive "Black Swan" candles. If a huge move occurs, the script temporarily allows trading inside that range, preventing the indicator from freezing during important volatility events.
- Outside Bar Sentiment: You can now control how Engulfing candles are handled using the Priority setting. Options include Auto (Lower Timeframe), Sentiment (Candle Color), or forced High/Low.
- Organized Settings: Label visibility settings are now grouped into compact rows, and the "Coloring Strategy" menu has been simplified.
Improvements
- Updated to use Absolute ZigZag Library v17.
- Improved structural accuracy for V-shaped reversals.
- Fixed tooltip information for Pivot Lows.
Note di rilascio
Version 18: Leg Dynamics & Market Structure EngineThis major update integrates the new v18 of the Absolute ZigZag Library which provides the following updates:
New Features:
The indicator now calculates and displays deep statistics about the effort (volume) and time within every zigzag leg. All new data is available in the pivot tooltips which can be turned off and on depending on your preferences. All tooltip data is visible by default.
- Leg Volume & Delta: See the total volume and the buy/sell pressure (Delta) for each leg.
- Smart Pressure Logic: Volume Delta is now calculated using a professional-grade "Wick-Adjusted Pressure" model, offering a more accurate view of market sentiment than simple candle color.
- Leg Duration: Analyze the duration of each leg in both Bar Count and a readable Time format (e.g., "4h 30m").
- Granular Tooltips: You now have full control over the visibility of every new data point in the settings menu.
Structural Logic Improvements
- More Accurate BOS Detection: The underlying logic for detecting "Close Breaks Pivot" has been improved. It now correctly identifies a Break of Structure even if the final pivot candle wicks back into the previous range.
- Breakout Timestamp: The library now tracks the exact candle that caused a break, improving accuracy for developers building strategies on top of this data.
Note di rilascio
v19Smart Noise Filtering & Structure Logic
This update introduces a new intelligence layer to the ZigZag engine, specifically designed to handle complex price action like Outside Bars (Engulfing candles) and volatility squeezes.
New Features:
- Smart Outside Bar Filter: Engulfing candles often create "micro-structures" (a High and Low on the same bar) that can clutter charts. You can now filter this noise. The logic is trend-aware: it preserves valid trend extensions while ignoring counter-trend wicks.
- Sentiment Override: When filtering is enabled, this new option ensures you don't miss powerful reversal signals. If a candle's close opposes the current trend (e.g., a strong Bullish Outside Bar during a Downtrend), the script allows it through immediately.
- Anti-Freeze Logic (Local Outside Bars): Previously, if price action remained inside a massive "Mother Bar" from the past, the ZigZag could stop updating (if "Ignore Inside Bars" was on). The new "Allow Local Outside Bars" setting lets the script detect fresh volatility even while technically inside a larger historical range.
Improvements & Fixes:
- Data Accuracy: Fixed an issue where single-bar reversals (Outside Bars) displayed "0" for Volume and Time statistics in the tooltips. They now correctly reflect the bar's actual data.
- Cleaner Menu: Settings are now organized into collapsible groups for better navigation.
- Performance: Optimized the core calculation engine for faster loading on high-timeframe charts.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.