Skip to content
All library documents

Detecting Wedges and Flags Across Multiple Zigzag Scales

Article TradingView scripts

Summary

This TradingView indicator scans price pivots from several configurable zigzag lengths to identify wedge and flag patterns. Users can choose patterns based on five or six pivots, display the underlying zigzag swings, and suppress some overlapping detections. Optional filters constrain the angle difference between boundary lines or require a line angle to fall within a selected range.

The script draws detected structures and can show alerts after a bar is confirmed, which is intended to avoid signals changing during live bar updates. It also limits the number of retained pattern references and supports chart color themes. The document describes detection and display logic, but supplies no performance study, trading rules, or evidence that the patterns predict returns. Zigzag pivots can be revised as later prices arrive, so users should account for confirmation delay and validate any trading use on their own data.

Key ideas

  • The indicator searches for wedge and flag structures using pivots from multiple zigzag lengths.
  • Patterns can be defined with either five or six pivots.
  • Angle filters can narrow detections according to the geometry of their trend lines.
  • Overlap suppression screens some patterns sharing pivots or starting regions, but nested wedges may remain.
  • Bar-confirmed alerts are offered to reduce changes caused by live price updates.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.