Blog/Chart Patterns: Automatic Double Top, Double Bottom and Rectangle Detection
Chart Patterns: Automatic Double Top, Double Bottom and Rectangle Detection
Indicators—

Chart Patterns: Automatic Double Top, Double Bottom and Rectangle Detection

How Crodl's Chart Patterns study finds double and triple tops and bottoms plus rectangles from swing pivots, with ATR-scaled tolerance and breakout confirmation.

Double tops and double bottoms are among the oldest, most cited structures in technical analysis — and among the most abused. Stare at any chart long enough and you can convince yourself two swings are "equal," a neckline exists, and a reversal is due. The pattern is real; the human application is where the edge dies.

The Chart Patterns study on the Crodl terminal applies the definitions mechanically. It builds swing pivots from the price series, matches them with a volatility-scaled tolerance, enforces the structural requirements a genuine pattern needs — a real prior trend, a real pattern height, no escaping legs — and only draws the pattern once price actually confirms it by closing through the neckline.

That last part is the study's defining honesty: you will never see a hopeful, half-formed pattern on your chart. Everything it draws completed and broke out.

What the study shows

Five formations are detected: double tops and triple tops (bearish), double bottoms and triple bottoms (bullish), and rectangles (direction decided by whichever side price breaks). Each detection draws as a translucent box spanning the pattern's full price band from its first pivot to the breakout bar, with a zigzag line tracing the actual pivots that formed it and a label at the breakout naming the pattern.

Bullish patterns are green, bearish red, by default, and the chart keeps the most recent Max patterns drawn detections (default 20).

PatternPivot structureDirectionConfirmed when
Double TopHigh – low – high (peaks match)BearishClose below the valley between the peaks
Double BottomLow – high – low (troughs match)BullishClose above the peak between the troughs
Triple TopThree matching highs, two valleysBearishClose below the lower valley
Triple BottomThree matching lows, two peaksBullishClose above the higher peak
RectangleFour alternating touches of a flat bandEitherClose beyond either boundary

How detection works on the Crodl terminal

  1. Build swing pivots. A pivot high is a bar whose high dominates ±Swing length bars (default 3); lows mirror. The pivot logic handles the ugly edge cases deliberately: a flat plateau of equal highs counts as one structural touch rather than minting phantom double tops, and an outside bar that is simultaneously a swing high and swing low is excluded as ambiguous.
  2. Match pivots with ATR tolerance. "Equal" peaks are peaks within Tolerance (x ATR14) of each other — 0.35 × the 14-period ATR by default. Volatility scaling means the same setting behaves sensibly on BTC and on a small-cap alt.
  3. Enforce pattern quality. Three structural gates filter out noise: the pattern's height must be at least twice the tolerance (a "pattern" shorter than its own noise band is indistinguishable from jitter); tops and bottoms must reverse an actual prior trend — price must have traveled at least one full pattern height beyond the neckline in the window before the pattern; and price must stay contained inside the pattern's band between the first and last pivot — no leg may have escaped in between.
  4. Wait for the breakout. The pattern is only recorded when a close crosses the neckline within 160 bars of the final pivot's confirmation. If price instead closes beyond the pattern's far extreme first — pushing above a double top's peaks, for example — the pattern is invalidated and never drawn. Rectangles watch both boundaries and take their direction from whichever side breaks.

Settings are compact: Swing length (pivot granularity, default 3), Tolerance (x ATR14) (match strictness, default 0.35), Max patterns drawn (default 20), plus labels and the three colors. Like its candlestick sibling, the study scans closed candles only — the forming bar can never conjure or destroy a pattern mid-tick. You can run all five detectors together or add any single pattern as its own study.

How traders use it

Post-breakout continuation and the retest

Because every drawn pattern already broke its neckline, the natural trade is the follow-through: the classic approach is to watch for a retest of the broken neckline and join in the breakout direction if it holds. The neckline frequently coincides with a Visible S/R zone — broken pattern support becoming resistance is the flip behavior that zone study highlights explicitly.

The measured move

The pattern box makes the traditional measured-move projection trivial: the box's height is the pattern height, and the conventional target is that height projected from the breakout point. It is a heuristic, not a law — but it gives a principled first take-profit region rather than a guess.

Review and pattern literacy

Scrolling history with the study active is a fast way to calibrate your eye: you see which "double tops" the mechanical definition actually accepted, and — more instructive — how many visually tempting ones failed the prior-trend or containment gates. Many traders keep it on precisely to argue with it.

Confluence across pattern scales

Structure nests. The second trough of a double bottom is often itself marked by a bullish candlestick pattern like a tweezer bottom or hammer, and the breakout leg frequently coincides with a trendline break. When the bar-scale, swing-scale, and line-scale tools agree, the setup is structurally redundant — in the good sense.

Honest limitations

The confirmation-first design cuts both ways: you get zero false "forming" patterns, but you also see every pattern only after the neckline break — this is a confirmation and context tool, not an anticipation tool. Pivots confirm Swing length bars after they print, adding a small structural lag. A breakout must occur within 160 bars of the pattern completing, or the pattern lapses undrawn. And the library is deliberately these five formations — head and shoulders, triangles, wedges, and flags are not detected.

Frequently Asked Questions

Why can't I see a pattern that's clearly forming right now?

By design. A pattern is only drawn once a close confirms it through the neckline — before that, it is a hypothesis, and the study does not draw hypotheses. If you want to trade the formation before confirmation, use the pivots and levels themselves; the study will validate you (or not) when the break comes.

Does it repaint?

No. Detection runs on closed candles only, and a pattern is recorded at its breakout bar with all conditions evaluated on data available then. Drawn patterns never move or vanish, except by rotating out of the Max patterns drawn window.

How does a rectangle get its direction?

It doesn't have one until the breakout: the pattern needs four alternating touches of a flat, ATR-tolerance-matched band, and the first close beyond either boundary stamps it bullish (upside break) or bearish (downside break).

What do Swing length and Tolerance actually trade off?

Swing length sets pivot granularity: smaller finds more, smaller patterns sooner; larger keeps only major structure. Tolerance (x ATR14) sets how equal "equal" must be: tighter tolerance means cleaner, rarer patterns; looser admits sloppier ones. The defaults (3 and 0.35) are a sensible middle for crypto timeframes.

Let the structure prove itself first

The Chart Patterns study is available on every Crodl terminal chart — add it from the indicator picker and every confirmed double top, bottom, and rectangle marks itself on your chart, alongside live trading on six exchanges.


This article is for educational purposes only and is not financial advice. Leveraged trading carries substantial risk of loss. Always do your own research and never risk more than you can afford to lose.

Share this article

Crodl

Ready to automate your trading?

Connect your exchange, set up automations, and start trading smarter — all from one platform.

Start Trading Free

More articles

Liquidation Bands: A Heatmap of Where Leverage Dies
Indicators
Liquidation Bands: A Heatmap of Where Leverage Dies
Liquidation Levels: How to Read Liquidation Magnets on a Crypto Chart
Indicators
Liquidation Levels: How to Read Liquidation Magnets on a Crypto Chart
All articles