Do Chart Patterns Work? Testing Triangles, Flags and Head and Shoulders

11 min readQuantParadox research

Every trading education course teaches chart patterns and almost none of them state a rule precise enough to program. That gap is not an oversight — it is where the patterns' apparent reliability comes from.

The short answer

Chart patterns such as head and shoulders, triangles and flags can be tested, but only after the pattern is defined by explicit numeric rules, because a detector loose enough to match the textbook illustrations usually fires on a large share of all bars.

Why are chart patterns so hard to backtest?

Chart patterns are hard to backtest because they are taught visually, and a visual definition contains an unlimited amount of unstated tolerance that the reader's eye fills in differently every time.

Consider head and shoulders. Three peaks with the middle one highest — but how much higher? Must the shoulders be similar in height, and within what tolerance? Must the neckline be horizontal, or may it slope, and how steeply? Over how many bars may the whole thing develop? Each unanswered question is a dial, and the eye sets all of them simultaneously and unconsciously in favour of examples that worked.

The result is that the pattern seems highly reliable in every book, because every illustration is a pattern that resolved as advertised. Nobody prints the fifty near-misses that did not.

Making it mechanical is unglamorous but transformative. Once every tolerance is a number, the detector can be run over a decade of data and the result is whatever it is — including the discovery that the definition you thought was strict matches far more of the chart than you expected.

What happens when a pattern detector is too loose?

A loose detector stops being a detector and becomes a description of ordinary price movement, and the failure is silent because a strategy built on it still produces trades and still produces a curve.

We ran into a concrete version of this in our own tooling. A double-top detector we audited turned out to be firing on roughly a third of all bars — which means it was not identifying a pattern at all, it was identifying that price sometimes goes up and then comes down again. Any statistics computed from it would have been statistics about the market, dressed as statistics about a pattern.

The check that catches this is embarrassingly simple and almost never run: count what fraction of bars your detector fires on. A genuine chart pattern should be rare. If the detector triggers on more than a small percentage of bars, the thresholds are too loose, and every result downstream is measuring the base rate.

The opposite failure is real too. Tighten until the detector fires forty times in a decade and the sample can no longer support a conclusion. Somewhere between those extremes is a definition that is both rare and frequent enough to measure, and finding it is legitimate work — as long as each attempt is counted as the trial it is.

How do you encode head and shoulders mechanically?

Encode it as a sequence of confirmed swing points with explicit tolerances on their relative heights, spacing and the neckline slope, all computable without reference to future bars.

Start from swing detection with a fixed lookback, confirmed with the appropriate delay so no future bars are used. Then require: a left shoulder peak, a head peak exceeding it by at least some ATR multiple, a right shoulder within some tolerance of the left shoulder's height, and intervening troughs whose connecting line does not slope more than some threshold.

The trigger is the neckline break, and it needs its own specification — a close beyond, by some margin, within some number of bars of the right shoulder. Without a deadline the pattern never expires and the detector accumulates open patterns indefinitely.

Every one of those thresholds is a parameter. Count them, fix them on one period, and grade once on another. A head and shoulders detector with eight parameters tuned on the same data it is measured on is not evidence about head and shoulders; it is a demonstration that eight parameters can fit anything.

Do triangles and flags perform differently from reversal patterns?

Continuation patterns such as flags and pennants are usually easier to define than reversal patterns, because they involve a measurable contraction after a measurable move rather than a specific arrangement of peaks.

A flag can be encoded as: an impulse of at least X ATR within N bars, followed by a consolidation whose range is less than Y fraction of the impulse, lasting between M and P bars, with the break in the impulse direction as the trigger. Every clause is a number, and none of them requires judgement about shape.

That relative tractability makes continuation patterns a better starting point for anyone building their own pattern research. You will spend less time arguing about geometry and more time on the parts that actually decide the answer: sample size, costs, out-of-sample validation and variant counting.

It is worth noting what this comparison does not claim. Easier to define is not the same as more profitable, and nothing about a cleaner encoding makes an effect exist. It simply means the test you run will be measuring what you think it is measuring.

What is the measured-move target and does it hold?

The measured move is the convention that a pattern's target equals its own height projected from the breakout point, and it is one of the easier pieces of pattern lore to check because it is entirely arithmetic.

The test is direct: for each detected pattern, compute the projected target and measure whether price reached it before reaching a defined invalidation, within a fixed horizon. Report the three outcomes — reached, invalidated, expired — rather than only the first.

In our own testing of ladder-style measured-move projections, the convention did not hold up well enough to build on, which is worth stating because measured moves are quoted almost universally without evidence. We treat that as a negative result on a specific family of projections rather than a universal verdict.

The more general lesson is that a target convention is a testable parameter, not a law. Projecting one hundred per cent of the pattern height is one choice among many, and if you find yourself trying sixty, eighty and one hundred and twenty per cent, you are running a search and the best of the three deserves the scrutiny a search result gets.

Questions people actually ask

What is the most reliable chart pattern?

There is no pattern with a settled claim to being most reliable, and any source quoting a specific success rate should be asked for the mechanical definition and the sample size behind it. Reliability figures for chart patterns vary enormously between studies precisely because each study encodes the pattern differently, which means they are not measuring the same thing.

How often should a chart pattern detector fire?

Rarely — that is what makes it a pattern rather than a description of normal price movement. A useful sanity check is to compute the fraction of bars on which your detector triggers. If it fires on a large share of the chart, the thresholds are too loose and any statistics derived from it will approximate the base rate for the instrument rather than telling you anything about the pattern.

Do chart patterns work on stocks as well as forex?

The geometry can be detected in any price series, but the execution details differ considerably. Equities gap overnight, which means a neckline break can occur at a price you could never have traded, and they have opening auctions that concentrate activity in ways spot forex does not. A pattern rule validated on FX should be re-tested on equities rather than carried across.

The only backtest that settles it is yours.

Build a strategy from a sentence, paste your own Python, or import your live trade history and have it graded. Five full backtests free, no card, and we'll tell you plainly when the result is indistinguishable from luck.

We publish research and tooling, not trading advice, and we make no claim about future returns. Everything above describes how to test an idea — not a reason to trade one.