ATR ZigZag - Volatility-Filtered Market Structure
Dec 8, 2025

The ATR ZigZag indicator utilizes an Average True Range (ATR) based threshold to identify significant swing highs and lows, providing a volatility-adjusted view of market structure. This tool filters minor price fluctuations by confirming new pivots only when price moves a specific distance beyond a prior extreme, ensuring a cleaner representation of trend changes and structural shifts.
Usage
The ATR ZigZag is designed to help traders map market structure and identify major price extremes objectively. By using volatility as a filter, it automatically adapts to different market conditions and timeframes.
- Structure Mapping: Use the dashed ZigZag lines to identify higher highs, lower lows, and overall trend direction.
- Support & Resistance: The latest pivot levels are extended horizontally, serving as potential areas of interest for future price action.
- Volatility Context: Enable the "ATR Boxes" to see a shaded 1×ATR zone around the most recent pivots, providing context on how much price typically fluctuates around these key levels.
- Real-time Tracking: The "Live Swing Leg" can be enabled to track the current price movement from the last confirmed pivot to the current swing extreme, helping to visualize the ongoing development of the market structure.
Details
Unlike traditional ZigZag indicators that rely on fixed percentage moves or bar counts, this script uses the formula:
threshold = ATR(length) × ATR_mult
A pivot is only confirmed once price reverses from an extreme by more than this calculated threshold. This introduces a natural lag, which is necessary to filter out market noise. To help users understand this lag, "Pivot Detection Markers" can be enabled to show exactly where the threshold was crossed to confirm a historical high or low.
Settings
- ATR Length: Sets the lookback period used to calculate the ATR value.
- ATR Mult: Multiplier applied to the ATR value to determine the distance required for pivot confirmation.
- Stale Swing Bars: Defines the duration after which a swing might be considered stale or requires a reset in logic.
- Switch On Prior High/Low Break: Determines if a trend switch should occur upon breaking the previous structural level.
- Show Confirmed ZigZag: Toggles the visibility of the primary dashed ZigZag lines.
- Show Current Pivot High/Low: Displays horizontal dashed lines at the most recent confirmed extremes.
- Show 1×ATR Pivot Boxes: Displays shaded zones around the latest pivots based on the current ATR.
- Show Live Swing Leg: Shows a real-time updating line from the last pivot to the current high/low.
- Show Pivot Detection Markers: Plots dots on the bars where a pivot was officially confirmed.
FAQ
How do I use ATR ZigZag to identify trend changes?
A trend change is typically indicated when the indicator confirms a new high that is higher than the previous high (uptrend) or a new low that is lower than the previous low (downtrend).
Does this indicator repaint?
Yes, by nature of a ZigZag, the lines "anchor" back to the historical high or low once the move is confirmed. The optional Detection Markers show exactly where the confirmation occurred to help you understand this behavior.
How can I access ATR ZigZag?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

