ZigZag Pass Node
ZigZag Pivot Detection — Series Input
Overview
The ZigZag Pass Node identifies significant price pivots in a series input by filtering out moves smaller than a specified percentage deviation. It outputs the pivot values at confirmed swing highs and lows — null between pivots — enabling swing-based analysis on any numeric series.
ZigZag is primarily a visual and analytical tool — it draws lines connecting significant swings, filtering out the noise between them. As a Pass node it accepts any numeric series, allowing swing analysis on derived indicator streams. Note that the last ZigZag line is always unconfirmed until the next pivot forms — the most recent pivot may be redrawn as new bars arrive.
Algorithm
Parameters
| Parameter | Default | Description |
|---|---|---|
| deviation | 5 | Minimum percentage move from a swing extreme required to confirm that pivot and begin a new swing |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any numeric series (price, oscillator, etc.) |
| values | Output | (number | null)[] | Pivot values at swing highs/lows; null between confirmed pivots |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Support and Resistance Levels
Collect non-null ZigZag pivot values and cluster them — high-density price levels represent historically significant support and resistance zones. The deviation parameter controls how significant a swing must be to qualify as a structural level.
Elliott Wave and Pattern Analysis
ZigZag pivots provide the anchor points for Elliott Wave counts, Fibonacci retracement measurements, and chart pattern detection (head and shoulders, double top/bottom). Use the pivot sequence to automate the identification of these structures.
Swing High/Low Detection
Filter the output to identify alternating swing highs and lows — use the sequence of pivots to determine whether the market is making higher highs and higher lows (uptrend) or lower highs and lower lows (downtrend), tracking overall trend structure.
Tips & Best Practices
ZigZag Is Repainting
The most recent ZigZag line is always provisional — the last non-null output value may change as new bars confirm or invalidate the current swing. Never use the current bar's ZigZag value as a live trading signal. Only use confirmed (past) pivots for backtesting.
Deviation Must Match Instrument Volatility
The default deviation=5% may be too tight for highly volatile assets (crypto) and too wide for stable instruments (T-bills). Calibrate by observing the pivot frequency on historical data — aim for 5–10 pivots per 100 bars as a starting point.
Use Pivot Timestamps Not Values Alone
When analyzing ZigZag output, pair each non-null value with its corresponding timestamp to build a pivot sequence. The timestamps tell you the time spacing between pivots — short spacing indicates rapid oscillation; long spacing indicates slow, sustained swings.