All indicators

ATR ZigZag - Volatility-Filtered Market Structure

Dec 8, 2025

Static chart image
Support and ResistancePatternsVolatilityRepainting Functionality

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.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.