Tool
Pattern Interpretor
condition.zigzag_pattern
Inputs
The pattern bundle from a market.zigzag_patterns node — the detected swing pivots plus their classification fields (direction, swing profile, envelope, net drift, peak position, code).
Outputs
A boolean that is true on each bar the pattern matches the chosen filter, for use as a signal trigger or filter gate.
Pattern Interpretor filters zigzag patterns so you only act on the shapes you want. Wire it to a Zigzag Patterns node and it tests each detected pattern by direction, swing profile, channel envelope, net drift, peak position, retracement depth, or an explicit list of pattern codes.
How it works
Wire the `pattern` handle from a market.zigzag_patterns node, then pick a mode; each mode reveals its own options and reads a different classification field of the pattern. The output is a per-bar true/false gate for a filter or signal.
Modes
Mode options
Tests whether the chosen leg of the pattern points up or down.
When to use: Keep only swings whose direction matches your trade bias (long vs short).
Admits patterns by how the swing sizes evolve — single, expanding, contracting, stable, or mixed.
When to use: Match the pattern's rhythm to your edge, e.g. only expanding (impulsive) swings.
Admits patterns by the high/low channel label of their pivots, e.g. HH_HL for a rising channel.
When to use: Keep only the channel shape you trade — a rising channel for longs, falling for shorts.
Tests whether the pattern drifts up or down overall from its first pivot to its last.
When to use: Filter on net direction even when the internal swings zig-zag both ways.
Tests where the highest pivot sits inside the pattern — first, interior, or last.
When to use: Pick patterns whose climax lands where your setup expects it (e.g. a final-leg high).
Matches the pattern against an explicit allow-list or block-list of pattern codes.
When to use: Trade only named shapes you have catalogued, and exclude the ones you avoid.
Admits patterns whose last leg pulls back into a chosen percent range (default 38.2-78.6).
When to use: Keep only pullbacks inside the classic Fibonacci entry zone.
Submode options
Direction is read from the pattern's first leg (its opening swing).
When to use: Filter on how the pattern started.
Direction is read from the pattern's last leg (its most recent swing).
When to use: Filter on the freshest move, the one you would trade into.
Direction options
Pass only when the tested leg points up (a rising swing).
When to use: Long-only swing entries.
Pass only when the tested leg points down (a falling swing).
When to use: Short-only swing entries.
Pass regardless of leg direction — a direction pass-through.
When to use: Symmetric setups that trade both sides.
Swing profiles options
A one-leg pattern — just a single swing, no further pivots.
When to use: Catch the simplest impulse or pullback.
Each successive swing is larger than the one before (broadening shape).
When to use: Trade momentum that is accelerating into a climax.
Each successive swing is smaller than the last (coiling / triangle shape).
When to use: Anticipate a breakout as range tightens.
Swings stay roughly the same size from leg to leg (an even channel).
When to use: Trade orderly, rhythmic structure.
Swing sizes grow and shrink with no single trend — an irregular shape.
When to use: Admit messy structure your other filters will narrow down.
Envelopes options
Highs and lows both step up — a clean rising channel.
When to use: Trade bullish trend continuation.
Highs rise while lows fall — a broadening (megaphone) channel.
When to use: Trade expanding volatility / breakouts.
Highs step up but the lows have no clear order.
When to use: Bullish-leaning structure with choppy support.
Only the highs are defined (too few pivots for a low label).
When to use: Short patterns where only the high side qualifies.
Highs fall while lows rise — a contracting (symmetrical) triangle.
When to use: Anticipate a breakout from a squeeze.
Highs and lows both step down — a clean falling channel.
When to use: Trade bearish trend continuation.
Highs step down but the lows have no clear order.
When to use: Bearish-leaning structure with choppy support.
Only the highs are defined and they step down.
When to use: Short patterns where only the high side qualifies, bearish.
Lows step up but the highs have no clear order.
When to use: Bullish-leaning structure with choppy resistance.
Highs have no clear order but the lows step down.
When to use: Bearish-leaning structure with choppy resistance.
Neither highs nor lows follow a clear order — pure chop.
When to use: Admit ambiguous structure your other filters refine.
Only the lows are defined and they step up.
When to use: Short patterns where only the low side qualifies, bullish.
Only the lows are defined and they step down.
When to use: Short patterns where only the low side qualifies, bearish.
Too few pivots to label either side (a degenerate envelope).
When to use: Admit the shortest patterns that carry no channel label.
Net drifts options
Admit patterns whose last pivot is above the first — a net upward drift.
When to use: Long-biased filtering on overall direction.
Admit patterns whose last pivot is below the first — a net downward drift.
When to use: Short-biased filtering on overall direction.
Peak positions options
The pattern's highest pivot is its very first one.
When to use: Patterns that top out immediately then unwind.
The highest pivot sits somewhere in the middle of the pattern.
When to use: Symmetrical peaks like a head between two shoulders.
The highest pivot is the most recent one — the pattern is making new highs.
When to use: Breakout / new-high continuation setups.
Code match mode options
The codes list is an allow-list — a pattern passes only if its code is in the set.
When to use: Trade an explicit short-list of named shapes.
The codes list is a block-list — a pattern passes unless its code is in the set.
When to use: Let everything through except a few shapes you avoid.
Configuration
Picks which boolean filter to run (direction, swing profile, envelope, net drift, peak position, code, or retracement) and reveals that mode's options.
In direction_filter mode, whether to test the pattern's first leg or its last leg.
In direction_filter mode, the required direction - up, down, or any (any acts as a pass-through).
In swing_profile_filter mode, the set of swing profiles to admit (single, expanding, contracting, stable, mixed).
In envelope_filter mode, the set of high/low channel labels to admit (e.g. HH_HL for a rising channel).
In net_drift_filter mode, whether to admit patterns drifting up, down, or both from first pivot to last.
In peak_position_filter mode, where the highest pivot sits - first, interior, or last.
In code_filter mode, the exact pattern codes to match, validated against the live catalog and the upstream leg count.
Whether the codes list is an allow-list (include) or a block-list (exclude).
In retracement_filter mode, the minimum pullback depth (percent) of the last leg; 38.2 is the classic lower bound.
In retracement_filter mode, the maximum pullback depth (percent) of the last leg; 78.6 is the common upper bound.
Off fires only on the bar the pattern's last pivot lands; on fires on later bars using the carried-forward classification.
Connects to
Examples
- Filter: only allow long signals when the direction_filter reports the first leg is up.
- Use retracement_filter with a 38.2 to 78.6 range to admit only pullbacks inside the classic Fibonacci zone.
Common mistakes
- Picking swing profiles, envelopes, or peak positions the upstream pattern can never produce for its leg count, which fails the sync validator.
- Using include match mode with an empty codes list, which never matches anything (an empty exclude list always passes instead).