Chart patterns · 20 formations
Head and shoulders, double tops, wedges, flags and triangles: exact geometry, a conventional target, and what invalidates each one.
Not measured here
These pages carry the geometry and the traditional claim, not a forward-return study like the candlestick section. That measurement is not done yet, and every page says so rather than implying a verdict.
A candlestick formation is arithmetic on adjacent bars. A hammer is a statement about one bar’s body and wicks; an engulfing is a statement about two. Both can be written as a condition and evaluated the moment the bar closes.
A head and shoulders cannot. It is a statement about swing points — three peaks, the middle highest, the outer two roughly level — and where a swing sits is not known when it forms. It is only known later, once enough further bars have printed without exceeding it. That is why this section existed for a long time as pictures and prose while the candlestick section had executable rules.
Each rule fires on the bar where the formation’s last required swing is confirmed. Not where the neckline breaks. Not where a trader would enter. A swing at bar k is returned only once pivotRight further bars have printed without exceeding it, so a rule cannot read a swing the market had not yet produced.
The cost of that, stated plainly
Confirmation lags the shape. By the time a detection is returned, the move a chartist would have traded is partly done. Any detector that identifies swings faster is using information the market had not yet produced — which is why its backtest looks better than its live results.
Every chart formation is built from the same five, published on each page so a count can be reproduced. Change one and the number of detections changes with it.
| Parameter | What it decides |
|---|---|
| pivotLeft / pivotRight | how many bars either side a swing must dominate before it counts as one |
| lookback | how far back the rule searches for the swings it needs |
| flatTol | how level two points must be to count as matching — what stops a head and shoulders firing on any three descending peaks |
| minSepAtr | how far apart the swings must be, measured in ATR so it means the same on gold and on EURUSD |
| atrPeriod | the window used to size everything above |
A rule is only reproducible if two implementations agree on it. The Python engine and the browser mirror were run against each other across D1, H4 and H1: 81,301 detections, 0 differing. Every rule was checked for look-ahead, and the pivot primitive carries a negative test — that a swing is invisible one bar before it confirms — because that is the failure this whole design exists to prevent.
Detection counts, not outcomes: this says how often the rule matches, and nothing about what followed. Measured on 2,938 BTCUSD D1 bars. Every formation fires; none is zero.
| Formation | Per 1,000 bars | Roughly |
|---|---|---|
| Bull Flag | 1.02 | once every 980 bars |
| Bear Flag | 1.70 | once every 588 bars |
| Inverse Head and Shoulders | 3.40 | once every 294 bars |
| Head and Shoulders | 4.08 | once every 245 bars |
| Bullish Pennant | 5.79 | once every 173 bars |
| Triple Bottom | 6.47 | once every 155 bars |
| Bearish Pennant | 6.81 | once every 147 bars |
| Symmetrical Triangle | 7.49 | once every 134 bars |
| Falling Wedge | 8.17 | once every 122 bars |
| Rectangle | 9.87 | once every 101 bars |
| Descending Triangle | 11.23 | once every 89 bars |
| Rising Wedge | 12.25 | once every 82 bars |
| Triple Top | 12.25 | once every 82 bars |
| Rounding Bottom | 14.64 | once every 68 bars |
| Ascending Triangle | 18.04 | once every 55 bars |
| Cup and Handle | 31.65 | once every 32 bars |
| Double Bottom | 38.12 | once every 26 bars |
| Double Top | 49.69 | once every 20 bars |
One symbol and one timeframe, so these transfer to FX and to intraday only loosely. A double top firing fifty times per thousand bars and a bull flag firing once are not equally informative events — the rare one narrows the range of what happens next far more, whatever either is worth.
The conventional split is by what the formation is said to do next. It is a statement about the tradition rather than about the data, and it is worth being explicit that the labels are inherited rather than derived.
| Family | The claim, and what it needs |
|---|---|
| Reversal | The prior trend ends. Needs a prior trend to reverse, which is why these rules carry a context requirement and fire far less often than the shape alone would |
| Continuation | The prior move resumes after a pause. The pole is what the rule measures, so the same consolidation after a rise and after a fall are two different formations |
| Bilateral | Direction is undecided until a boundary breaks. Symmetrical triangles and rectangles sit here, and they are the only ones whose label makes no directional claim at all |
Every chart formation carries a conventional target: the head-to-neckline distance projected down from the break, the pole length projected from the flag, the cup depth projected above the handle. These appear on each page because they are what the tradition specifies, and they are labelled as the traditional claim for the same reason.
None of them has been measured here. A projection is a rule for drawing a line, and whether price reaches that line at a rate better than chance is exactly the question the withheld study was meant to answer. Treat the target as a description of what other participants are likely watching, which is a weaker claim and a defensible one.
Worth knowing
The neckline, the pole and the handle are all lines someone draws. Two analysts drawing them on the same chart will not agree, and the disagreement is larger than most published target statistics acknowledge. The detector avoids the problem by working from confirmed swing points instead, which is why its detections lag where a chartist would have entered.
Forward returns. No hit rate, benchmark or interval appears on any chart formation page, because the measured run that would supply them was computed on a superseded engine and predates these eighteen formations entirely. It was withdrawn rather than published with a caveat. When the re-run completes, these pages get measurements for the first time — and they will carry a benchmark and a correction across the whole family of 125, or they will not be published.