Quant Analytics: from scratch to pro · Indicators, honestly measured · Advanced
Chart patterns: definitions, base rates and how to test them
Head and shoulders, double bottoms and triangles are described in words, and words leave room. To test a pattern it has to be turned into an exact rule, counted, and compared with what follows any other day. Lo, Mamaysky and Wang (2000) showed one way to do this.
In this lesson
- Turn a verbal chart pattern into an exact, testable rule
- Explain how smoothing choices decide which wiggles count as a pattern
- Count how many variants a definition produces and what that does to false positives
- Work out how many pattern occurrences a test needs
Read first: Does an indicator carry information? Measuring it honestly, Reading a price chart
Chart patterns are a long-established form of technical analysis: shapes in price history that are said to precede particular moves. A trader sees a head and shoulders on a chart and expects a reversal. Whether the pattern carries any information is a statistical question, and it cannot be answered until the shape has a definition a computer can apply.
From a drawing to a rule
Take the double bottom: two lows at about the same level with a rally between them. Every word in "about", "rally" and "between" is a parameter.
- How close must the two lows be? Within 2%, 3%, 5%?
- How many bars must separate them?
- How far must the rally between them rise?
- Does the pattern count when the second low is made, or when price breaks above the middle peak?
Each choice produces a different set of events. A test that fixes one definition after seeing which works has used the data to pick the pattern.
Smoothing decides what the shape is
Prices wiggle at every scale. To find a head or a shoulder one needs to decide which wiggles count, and the usual way is to smooth the price and look for turning points. Lo, Mamaysky and Wang (2000) used kernel regression: each smoothed value is a weighted average of nearby prices, with weights from a bell-shaped kernel and a bandwidth h that sets how far the average reaches.
Worked example. Three prices 104, 100 and 103, at steps -1, 0 and +1 around the centre. With a Gaussian kernel and h = 1 the neighbours get a weight of exp(-0.5) = 0.607 relative to 1 for the centre. The smoothed value is (104 x 0.607 + 100 + 103 x 0.607) / (1 + 2 x 0.607) = 101.92. A plain average gives 102.33. The kernel keeps the centre point closer to its own value.
A larger bandwidth smooths more and finds fewer, bigger patterns. A smaller one finds more and smaller ones. The bandwidth is a parameter of the pattern. It has to be fixed by a stated criterion before the test. Lo, Mamaysky and Wang applied their algorithm mechanically to a large number of US stocks from 1962 to 1996. The advantage of the algorithmic approach is that every occurrence is found, not only those that look good.
What they compared
The comparison was between the distribution of returns after a pattern and the distribution of returns on any day (the unconditional one). This is the base rate logic of measuring an indicator honestly. They concluded that several technical indicators provide incremental information, and wrote that these may have some practical value. That is a statement about statistical differences in return distributions; the lesson to take is the design, not a promise of a profitable rule. Whether a difference survives transaction costs and holds in other periods is a separate test.
Counting variants
Suppose the double bottom has 3 choices for the tolerance, 3 for the separation and 3 for the rally: 3 x 3 x 3 = 27 variants. If every variant were an independent test on noise, the chance that at least one passes at 5% is 1 - 0.95^27 = 75.0%. The variants overlap heavily, so the real figure is lower, but a reported "best" version is not a 5% result. Report all variants, or use a method that tests the best against the full set, such as White's (2000) reality check.
Worked example: sample size
A pattern occurs 40 times in 20 years of a single market. Ten days after it, the return averages 0.5% more than on a typical day, with a standard deviation of 4%.
- Standard error:
4% / sqrt(40)= 0.63%. - t-statistic: 0.79.
To reach a t-statistic of 1.96 for a 0.5% excess takes (1.96 x 4% / 0.5%)^2 = 246 independent occurrences. At two occurrences a year that is 123 years. Rare patterns on one instrument cannot be tested to a useful standard. The answer is to pool many instruments, which is what a cross-section does, and to remove the overlap between occurrences.
Common mistakes
- Judging a pattern from examples picked by eye. The ones that failed look like nothing and are forgotten.
- Changing tolerances until the count of successes looks good.
- Counting two overlapping occurrences of one pattern as two events.
- Using the same market and period to find and to confirm the pattern.
- Quoting the difference in means without the base rate or the standard error.
In practice
For any pattern claim, ask for the written rule, the parameter choices and how many were tried, the count of occurrences, and the base rate it was compared with. If the rule cannot be written down exactly, it cannot be tested, and a claim about it is an opinion. If it can, the test is the same event study as for any indicator. Analytics on FinUties applies measures like these to the markets it covers, so they are at hand when you read a chart.
Worked numbers
Each result is recomputed from the formula shown.
| What | Formula | Result |
|---|---|---|
| number of definition variants | 3 * 3 * 3 | 27 |
| chance that one of 27 independent noise variants passes | 1 - 0.95**variants | 75.0% |
| kernel weight one step away, bandwidth 1 | exp(-0.5) | 0.607 |
| kernel-smoothed value of 104, 100, 103 | (104 * w1 + 100 + 103 * w1) / (1 + 2 * w1) | 101.92 |
| plain average of 104, 100, 103 | (104 + 100 + 103) / 3 | 102.33 |
| standard error with 40 occurrences | 0.04 / sqrt(40) | 0.63% |
| t-statistic of a 0.5% excess | 0.005 / se40 | 0.79 |
| occurrences needed for t = 1.96 | (1.96 * 0.04 / 0.005)**2 | 246 |
| years needed at 2 occurrences a year | n_need / 2 | 123 |
Check yourself
A double-bottom definition has 3 choices for the tolerance between lows, 3 for minimum separation and 3 for the minimum rise between them. How many variants is that, and what is the chance that at least one noise variant passes a 5% test?
3 x 3 x 3 = 27 variants. If independent, 1 - 0.95^27 = 75.0%. The variants overlap, so the true figure is lower, but not close to 5%.
A pattern appears 40 times in 20 years. After it, the 10-day return averages 0.5% more than usual, with a standard deviation of 4%. How significant is that?
SE = 4% / sqrt(40) = 0.63%, so t = 0.79. Not significant.
How many occurrences would a 0.5% excess need to reach a t-statistic of 1.96?
n = (1.96 x 4% / 0.5%)^2 = about 246 independent occurrences.
Why is a pattern drawn on a chart after the move a poor test?
The eye picks the pattern with hindsight, so every drawn example is a success by construction. A test needs a rule that fixes the pattern before the outcome is seen, and that counts every occurrence, including the ones that fail.
Key terms
Checked facts
Every figure below carries how it was checked: Primary checked (read in the cited primary, official, academic or data source), Two sources agree, or Approximate (an order of magnitude only).
- Primary checked
Lo, Mamaysky and Wang (2000) built an algorithm that recognises chart patterns by nonparametric kernel regression and applied it to a large number of US stocks from 1962 to 1996.
- Primary checked
They compared the distribution of returns after patterns such as head-and-shoulders and double bottoms with the unconditional distribution, and concluded that several technical indicators provide incremental information.
Sources
- Foundations of Technical Analysis: Computational Algorithms, Statistical Inference, and Empirical Implementation. The Journal of Finance 55(4), 1705-1765 (Andrew W. Lo, Harry Mamaysky, Jiang Wang), 2000. Accessed 9 Nov 2026
- A Reality Check for Data Snooping. Econometrica 68(5), 1097-1126 (Halbert White), 2000. Accessed 9 Nov 2026
- The Econometrics of Financial Markets. Princeton University Press (John Y. Campbell, Andrew W. Lo, A. Craig MacKinlay), 1997. Accessed 9 Nov 2026