ZigZag

Swing points, each confirmed by a move of at least Reversal % against the last swing.

Overlay · zigzag

What it computes

Swing points, each confirmed by a move of at least Reversal % against the last swing.

It describes bars that have already printed. QuantZ does not claim this indicator has predictive value, and it is not a recommendation to do anything.

Inputs and lookback

  • Reversal % · default 5

Reads open, high, low and close from the loaded bars. The first value appears once the longest lookback its parameters name has elapsed; earlier bars are left empty rather than padded. It marks some bars and not others, so its output has real gaps by design.

What it assumes about the series

  • Bars arrive oldest to newest at one interval, each with a finite open, high, low and close. The input is the chart’s loaded series, whatever its length.
  • The function is given bars, not sessions: it does not know the timeframe, where a session opens, or that a gap in the tape is a gap.
  • Warm-up bars are omitted rather than padded. The first value appears once the arithmetic has enough history, and nothing is drawn before it.
  • The newest bar is the forming bar. Its value uses the live close and settles when the bar closes.

Whether a drawn value can change

last-leg · Redraws its last leg. The most recent point is provisional until a later reversal confirms it, so a value already drawn on a closed bar can move or be replaced.

This class is read from the registry entry and checked by a test against the function itself: for a class that says closed bars are final, appending a bar must leave every earlier point unchanged, and for a class that says they are not, it must not.

Outside its inputs

  • Nothing outside the loaded bars: no longer history than the chart has loaded, and no other interval.
  • Nothing inside a bar: no individual trades, no order book, no bid or ask.
  • No other symbol, no benchmark, no news, no fundamentals, no earnings dates.
  • Volume is not read at all.

Rendered from the registry entry zigzag in src/lib/indicators.ts. If the entry changes, this page changes with it.