All indicators

Price Action ZigZag (Impulses & Corrections)

Nov 11, 2025

Static chart image
Price Action BasedPivot Based (Retrospective)

The Price Action ZigZag (Impulses & Corrections) indicator tracks market structure by connecting significant swing highs and lows to provide a clear, non-repainting view of trend legs and pullbacks across any timeframe.

Usage

The tool is designed to help traders visualize market structure without the noise of minor price fluctuations. By adjusting the sensitivity of the swing detection, users can adapt the tool for different trading styles:

  • Trend Identification: The indicator automatically identifies "Impulses" (moves that extend the trend in the direction of previous breaks) and "Corrections" (moves that retrace but do not exceed previous highs or lows).
  • Scalping: Use a lower Pivot Length (e.g., 2–5) to capture micro-structures and quick momentum shifts.
  • Swing Trading: Use a higher Pivot Length (e.g., 10+) to identify major trend cycles and significant support/resistance levels.
  • Visual Cues: Impulse legs are highlighted in a distinct color (default blue) while corrections are shown in gray. Optional labels provide immediate feedback on the nature of the current move.

Details

The script utilizes the ta.pivothigh and ta.pivotlow functions to identify structural points. A key characteristic of this implementation is that it is strictly non-repainting; lines and labels are only drawn once the pivot is confirmed by the user-defined length, ensuring that the historical data remains accurate for backtesting and analysis.

The logic for categorization is as follows:

  • Bullish Impulse: A move from a higher low to a higher high.
  • Bearish Impulse: A move from a lower high to a lower low.
  • Correction: Any move that acts as a retracement or sideways action between alternating swing points without creating a new trend extension.

Settings

  • Swing (Pivot) Length: Determines the number of bars required on either side of a high or low to confirm a swing point. Higher values result in broader, more significant structure.
  • Label Impulses and Corrections: Toggles the visibility of the "Impulse" and "Correction" text labels on the chart.
  • Impulse Line Color: Sets the color for trend-extending legs.
  • Correction Line Color: Sets the color for retracement legs.

FAQ

How do I access Price Action ZigZag (Impulses & Corrections)?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Does this indicator repaint?

No, the indicator only prints lines and labels after the pivot length has been fully confirmed, meaning the data shown is final and will not change.

What is the best timeframe for this tool?

The indicator is timeframe-agnostic. It works equally well on 1-minute charts for scalping or weekly charts for long-term investment analysis, provided the Pivot Length is adjusted accordingly.

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.