Documentation

5. Chart Patterns

Created
Jun 5, 2026
Updated
Jun 5, 2026

Chart-pattern detectors find classic price formations automatically and draw them on the price pane, complete with the breakout line, a projected target, and a stop. Add them from the indicator picker like any other study.

Patterns detected

The library ships ten patterns in two families:

  • Continuation — Bull Flag, Bear Flag, Bull Pennant, Bear Pennant.
  • Reversal — Double Top, Double Bottom, Triple Top, Triple Bottom, Head & Shoulders, Inverse Head & Shoulders.

A flag is a consolidation bounded by two roughly parallel trendlines leaning against the prior move; a pennant is a consolidation bounded by two converging trendlines that narrow to an apex. Double/triple tops and bottoms use a horizontal neckline, while head-and-shoulders uses a five-pivot structure with a sloped neckline.

They follow the standard technical-analysis definitions. A separate study, Williams Fractal, marks individual fractal pivots and is also listed under the Patterns category in the picker.

Inputs

Continuation patterns (flags and pennants) share these inputs:

InputDefaultMeaning
Pivot legs5The 5/5 pivot window that anchors the poles.
Min pole move %20Minimum sharp move for a valid pole.
Max pole bars20Look-back for the start of the pole.
Min consolidation bars3Shortest consolidation accepted.
Max consolidation bars15Longest consolidation searched.
Max retrace %60Deepest pullback allowed, as a % of the pole.
Flag channel deviation %15Parallel tolerance (flags only).

Double and triple tops/bottoms share their own inputs:

InputDefaultMeaning
Pivot legs5The 5/5 pivot window that anchors the extremes.
Tops match tolerance %5Max % difference across the matching tops/bottoms.
Min pattern height %3Minimum neckline-to-extreme height, as a % of price.
Max pattern width120Maximum bars spanned by the matching extremes.

Styling

Each pattern study exposes style options: Color, Width, Show target / stop, and Show labels. Toggle the target and stop lines off if you only want the pattern outline.

Next steps

You have covered indicators. Move on to backtesting.

Next: Backtesting Overview