Support and resistance, head and shoulders, double tops, triangles, flags: this is the part of technical analysis that most people picture first, and it is the part that is hardest to test. A moving average is a formula. A head and shoulders is a shape, and a shape needs a definition before a computer can find it. The moment you write the definition, you discover that the claim and the definition are two different things. This module takes one support rule, writes it as exact arithmetic, tests it on the Nifty 50 against a placebo, and then counts how many head and shoulders patterns the same index contains under different definitions. The answer to that second question is the most useful number in the module.
The data runs from 1 Jan 2021 to 30 Sep 2026, about five and three quarter years, one market regime. Read every result as one test. Education only, not advice.
6By the end you can
- Say which parts of a chart pattern claim can be written as a rule and which parts cannot.
- Define a pivot low and a support level without using information from the future.
- Read the result of a support rule against holding the index, and against a placebo built from random levels.
- Explain why the number of head and shoulders patterns in a chart changes with the tolerance you choose.
- Summarise what Lo, Mamaysky and Wang (2000), Osler (2000) and Savin, Weller and Zvingelis (2007) did, and what they did not test.
- List what a pattern claim needs before it can be tested.

What can be written as a rule
A claim is testable when four things are fixed: the situation that triggers it, the action, the exit, and the outcome you will measure. "Price bounces off support" has none of the four. Which price level counts as support? How close is close? What is a bounce, and how long does it have to last? A rule fixes each of these with a number.
Read 2 more paragraphs, 152 words
Here is the sorting I use. Some chart ideas convert cleanly. A price level defined by past closes is one: the highest close of 252 sessions was the 52 week high of module 23.6. A level defined by pivots is another, as I show below. Other ideas convert only after you add choices the claim never made. A head and shoulders has three peaks with the middle one higher. How much higher? How close in height must the shoulders be? Over how many sessions? Each answer is a parameter, and each parameter can change the count and the result.
The rest cannot be converted at all, because they depend on the eye of the person drawing them. "Strong support", "a clean breakout", "a pattern that looks complete": until the words are replaced by numbers, there is nothing to test, and a claim that cannot lose cannot be shown to win either.
A pivot, and the look ahead trap
Support lines are usually drawn through previous lows. To write that, you need a definition of a low that matters. I use a pivot: a close that is the lowest of the 11 sessions centred on it, five before and five after. A pivot high is the same with the highest. On the Nifty 50 data there were 81 pivot lows and 83 pivot highs among the 1,420 sessions.
is below the 5 closes before
and the 5 closes after.
Known only on day p + 5.
Pivot high: the reverse.
Read one more paragraph, 108 words
The definition carries a trap. A pivot on day p can only be recognised on day p+5, because it needs five later closes to confirm that none of them was lower. On a chart drawn after the fact, the low is plain to see on the day it happened, and the eye marks it at once. A rule cannot. A rule on day t may use only pivots from day t-5 or earlier. If you let a rule use a pivot on the day it forms, you are using the future, and every result is inflated. All the tests in this test set follow the five session delay.
The term this section turns on: Pivot low
One support rule, written out
With pivots defined, a support rule can be stated in four lines. The level S is the most recent confirmed pivot low, if it is no more than 120 sessions old. The idea is that price returns to a recent low, finds buyers, and moves up, so the rule enters when price comes back down to that level. It exits if the level fails, because that was the claim, or after a fixed time.
low, at most 120 sessions old
Enter: close from S up to
1.01 x S
Exit: close below 0.98 x S,
or after 20 sessions
Read one more paragraph, 58 words
Every number here is a choice: 120, 1%, 2%, 20. A chart reader makes similar choices by eye and does not write them down. Writing them down is what lets the rule be tested, and it also makes plain how many dials there are. This module runs the rule once with these settings. I did not tune them.
How S1 did
The test window runs from 15 Feb 2021, once the first pivots are available, to 30 Sep 2026: 1,389 sessions, 5.62 years. Signals are computed at the close of day t and traded at the close of day t+1. Each entry and each exit costs 0.1% of value, an illustration of costs and not a quote. Cash earns 0%. Buy and hold is shown over the same dates and pays the 0.1% once.
| 15 Feb 2021 to 30 Sep 2026 | CAGR | Max drawdown | In market |
|---|---|---|---|
| Buy and hold | 7.17% | -17.23% | 100.0% |
| S1 support bounce, 79 trades | 1.24% | -15.22% | 46.4% |
₹100 in Allcap became about ₹424 in the model
Test script for this module. Nifty 50 price index, 0.1% per side, cash at 0%. Trades count every entry and every exit.
Read 2 more paragraphs, 144 words
S1 returned 1.24% a year against 7.17% for holding the index, with a drawdown of -15.22% against -17.23%, and it was in the market 46.4% of the time. It did worse than holding on return. Of its 40 round trips, 17 made money and 23 lost. The average winner was 3.90% and the average loser was -2.46%, and a trip lasted 16.1 sessions on average. The median round trip lost 0.31%. Of the 40 exit signals the script counted, 14 came from a broken support level and 26 from the 20 session limit.
That split already says something. The rule is built on the claim that support holds. Over these dates, 14 of the 40 exits came from a level that broke, by the rule's own 2% definition. The other 26 were exits on time, a mixed bag of small gains and small losses.
Did the level hold?
A fairer question than the return of the whole rule is a simple count. For each pivot level, take the first time the close came within 1% above it, and see what happened over the next 20 sessions. There were 51 such first touches. In 33 of them the level held, meaning no close fell more than 2% below it within 20 sessions. In 18 of them it broke. So support held about two times in three.
Read one more paragraph, 90 words
Is two in three high or low? It depends on what you compare it with. The average 20 session return after a first touch was 0.67%. The average 20 session return over every session in the data was 0.72%. A first touch of support was followed by roughly the same return as any other day. The level held more often than it broke, but a random day also holds more often than it breaks, because the index drifted up. The count alone does not tell you that support carried information.
A placebo test
This is the test I trust most for this kind of rule. Take the rule as it is, and replace the support level with an arbitrary one: each time a new pivot would be confirmed, choose instead a random close from the previous 120 sessions and treat that as the level. The mechanics are identical, the same entry zone, the same exits, the same costs, the same dates when a new level appears. The only thing removed is the claim that a pivot low means something. If S1 is capturing something real about pivots, it ought to do clearly better than the placebo. I ran the placebo 200 times with a fixed seed so you can reproduce it.
| S1 against 200 placebo runs | CAGR |
|---|---|
| S1 with real pivot lows | 1.24% |
| Placebo median | 0.38% |
| Placebo 5th percentile | -3.69% |
| Placebo 95th percentile | 3.68% |
| Placebo runs above S1 | 57 of 200 |

Test script for this module, seed 7. Same window, entry zone, exits and costs as S1. The placebo level is a random close from the previous 120 sessions.
Read 2 more paragraphs, 168 words
S1 at 1.24% sat a little above the placebo median of 0.38%, and 57 of the 200 placebo runs did better than the real rule. If real pivot lows carried a strong signal, you would expect almost none of the placebo runs to beat it. The real rule was well inside the range of what random levels produced, from -3.69% to 3.68%. The placebo made between 30 and 62 trades, median 46, against S1's 79 trades, so they are not identical in activity, and I would not stretch the comparison. But the honest reading is: on this index and these dates, pivot lows did not do visibly better than random closes as support levels.
This is the general method. When a claim is that a particular level matters, the control is a level that does not matter. Without a control you do not know whether the rule is reading structure in the price or whether any rule with the same entry and exit shape would earn the same.
The head and shoulders count
Now the pattern. A head and shoulders top has three peaks. The middle one, the head, is higher than the two on either side, the shoulders. To count them with a computer, I use the pivot highs above. Take any three consecutive pivot highs P1, P2 and P3. The pattern needs P2 to be higher than both P1 and P3 by at least a head margin, and P1 and P3 to be within a shoulder tolerance of each other. Those are the two dials the picture never specifies.
| Shoulder tolerance | Head margin | Matches |
|---|---|---|
| 2% | 0% | 13 |
| 2% | 3% | 1 |
| 5% | 0% | 17 |
| 5% | 3% | 1 |
| 10% | 0% | 21 |
| 10% | 3% | 1 |
Test script for this module. Three consecutive pivot highs (K = 5) in the Nifty 50 closes, 1 Jan 2021 to 30 Sep 2026. Tolerance is |P1 - P3| as a share of P2. Margin is how much higher P2 must be than each shoulder.
Head margin: the largest is 2% at 3%
Read 3 more paragraphs, 233 words
The same chart holds 1 pattern or 21, depending on two settings that nobody can say are right. With the strictest definition I tried, a 3% head margin, there was a single head and shoulders in nearly six years. Loosen the head margin to zero, which only asks the middle peak to be the highest of the three, and the count rises to between 13 and 21. A person looking at the chart will find as many as the eye is willing to see.
A made up example shows the arithmetic. Say three consecutive pivot highs close at 24,000, 24,800 and 23,700. The shoulders differ by 300 points, which is 1.2% of the head at 24,800, so they pass a 2% tolerance. The head is 3.3% above the first shoulder and 4.6% above the second, so it passes a 3% margin as well. Change the third peak to 23,300 and the shoulders now differ by 2.8% of the head: the pattern is gone at 2% tolerance and back at 5%. Nothing about the price changed, only the definition.
This is why most pattern claims are untestable as stated. "A head and shoulders predicts a fall" has no number of patterns attached to it. The claim has to be fixed to a definition first. And if the definition is chosen after you see which choice gives the cleanest result, the test is already compromised.
Does the neckline break follow through?
Given a definition, you can test the claim. The traditional claim is that once price closes below the neckline, the lowest close between the first and third peak, a fall follows. I counted completions as the first close below the neckline within 40 sessions after the third peak is confirmed, and measured the next 20 sessions.
| Tolerance / head margin | Matches | Completions | Mean next 20 sessions |
|---|---|---|---|
| 2% / 3% | 1 | 1 | -5.10% |
| 5% / 0% | 17 | 11 | 0.11% |
| 10% / 0% | 21 | 12 | 0.33% |
| Every session | - | - | 0.72% |
Test script for this module. Mean return of the 20 sessions after the first close below the neckline. The last row is the mean over every session in the data.
Read 2 more paragraphs, 150 words
The strictest definition has one completion and it was followed by a fall of 5.10%, which is what the pattern predicts. One event is an anecdote. The looser definitions have 11 and 12 completions, and the average of the next 20 sessions was a gain of 0.11% and 0.33%, not a fall. The average day gained 0.72%. So on this index, completions of the pattern were followed by a little less than the average day, and not by a fall.
I would not call this a rejection. Eleven and twelve events are too few, and I chose these definitions in a few minutes. It is exactly the kind of result that shows why a pattern claim needs a fixed definition, many occurrences and a baseline. It also shows that the one clean looking example on the chart, the strictest match, is the one that is most likely to be quoted.
What the research did
Andrew Lo, Harry Mamaysky and Jiang Wang (2000) did the serious version of the exercise above. They wrote an algorithm that smooths the price with a kernel regression, finds the local extremes, and checks them against definitions of head and shoulders, double tops and bottoms, triangles and others. They applied it to US stocks from 1962 to 1996 and reported that several of the patterns offered some incremental information. The paper is the reason that pattern recognition is a testable subject at all. Notice what they had to do first: make the patterns precise enough for a computer.
Two terms to hold on to from 23.7
Read 3 more paragraphs, 299 words
Gene Savin, Paul Weller and Janis Zvingelis (2007) took the head and shoulders on its own. They used a modified version of the Lo, Mamaysky and Wang algorithm on S&P 500 and Russell 2000 data from 1990 to 1999. Their published abstract reports that a stand alone trading strategy based on the pattern showed little or no profitability, while a strategy conditioned on the pattern earned risk adjusted excess returns of 5 to 7 percent a year. That is a more careful finding than either "it works" or "it does not". It also has a very different shape from my small count, because it uses many US stocks and not one index.
Carol Osler (2000) studied support and resistance levels in currencies. She tested levels that six firms active in foreign exchange published to their customers, from 1996 to 1998, against one minute quotes during the day, and reported strong evidence that the levels predicted interruptions of intraday trends, with the power varying across currencies and firms. Her later staff report seeks an explanation in the placement of stop loss and take profit orders. That is a good example of a testable support claim: the levels were fixed in advance by the firms, the outcome was defined, and the market was one where orders cluster at round numbers. It is a different market and a different horizon from a daily Nifty 50 close, and I would not carry the result across.
Finally, Cheol-Ho Park and Scott Irwin (2007) surveyed the field. They reported profits for technical rules in several markets until the early 1990s, and that most studies suffer from data snooping, choosing the rules after the results, and trouble measuring risk and transaction costs. Pattern recognition is especially exposed to the second problem, because the dials are many.
What a pattern claim needs before it can be tested
- A definition with numbers. Window, tolerance, margin, the delay before the pattern is known.
- No look ahead. The pattern may use only closes up to the day it is recognised, and the trade happens at the next close.
- A count. How many times the pattern occurred under that definition, and in how many independent stretches of the data.
- An action and an exit. What you do on recognition, and when you leave.
- A baseline. What the average day, or a random level, would have given with the same exit.
- The neighbours. The result when each number is moved a little.
- Costs. A rule that trades on every touch pays the 0.1% a side many times.
A claim that clears all seven can lose, and that is what makes it worth taking seriously when it wins.
Read one more paragraph, 88 words
When I meet a pattern I like, I go through the same list in order. First I write the definition in a few lines. Then I count the matches before I look at what followed them. Only then do I measure the outcome, against the average day and against a placebo. Most of the time the exercise ends at the count: either there are too few matches to say anything, or the number of matches depends so much on a dial that the claim has no stable meaning.
Where support rules break
- Which level. Pivots with K = 5 gave 81 lows in nearly six years. A different K gives a different map of levels and a different rule.
- Levels that fail. Of 40 exits, 14 came from a level that broke by the rule's own 2% test. A level that holds and a level that breaks look the same on the day of the touch.
- Fixed exits. The 20 session limit caused 26 of the exits. A different time limit gives a different mix of winners and losers.
- Drift. In a rising market almost any rule that holds the index looks right some of the time. The placebo run is how you check.
- Selection. If you only study levels that were drawn on a chart after the move, you are studying the ones that worked.
Where this section sits in module 23.7
Where this meets how RupeeCase works
In my years of trading I have seen many chart pattern claims, and the ones that held up were the ones that could be stated as numbers. That is a view of mine and not a finding from this test. RupeeCase strategies are written the same way: a universe, a score and a schedule, published so that they can be checked. Module 23.8 shows the steps from a single indicator to a rule set with sizing and a record. For the general method of back testing, module 2.4 covers what a back test can and cannot show.
Common mistakes
- Marking the low on the day it forms. A pivot is known five sessions later. A rule that uses it earlier uses the future.
- Counting only the patterns that worked. Count every match under a fixed definition.
- Leaving out the control. Compare a level rule with random levels and compare a pattern with the average day.
- Changing the definition after the result. The count here moved from 1 to 21 with two dials.
- Treating one example as a finding. The strictest head and shoulders had one completion.
- Carrying a result across markets. The currency levels in Osler (2000) were tested on intraday quotes.

What I'd keep from this
- A chart claim is testable only when its trigger, action, exit and outcome are fixed with numbers. A pivot is known five sessions after it forms, and a rule must wait.
- Over 15 Feb 2021 to 30 Sep 2026, holding the index gave 7.17% a year. The support rule S1 gave 1.24%, with a -15.22% drawdown. Of its 40 exits, 14 came from a level that broke.
- In a placebo test with random levels, 57 of 200 runs did better than S1. Real pivot lows did not stand out.
- The number of head and shoulders patterns in the same chart ranged from 1 to 21, depending on two settings.
- The research is mixed and about other markets. Lo, Mamaysky and Wang (2000) and Osler (2000) found some information. Park and Irwin (2007) warn about data snooping.
Questions readers ask
Can support and resistance be tested?
Yes, once a level is defined with numbers, for example the latest confirmed pivot low, together with an entry zone, an exit and a baseline. A line drawn by eye cannot be tested because the drawer chooses it after seeing the price.
Does head and shoulders predict a fall?
Under one strict definition on the Nifty 50, there was a single completion, followed by a fall of 5.10% over 20 sessions. Under looser definitions with 11 and 12 completions, the next 20 sessions averaged small gains. Lo, Mamaysky and Wang (2000) and Savin, Weller and Zvingelis (2007) tested the pattern on large US samples and reported mixed results.
Why does the number of patterns change with the definition?
Because a drawing does not say how much higher the head must be or how close the shoulders must be. Those are parameters, and the count in this test ranged from 1 to 21 across six settings.
What is a placebo test for a trading rule?
You keep the rule's entry, exit and costs and replace the signal with a meaningless one, such as a random level. If the real rule does not clearly beat the placebo runs, the rule's edge may come from its shape and the market's drift, not from the signal.

Rules and figures in this module were last verified on 27 Nov 2026. Tax and regulatory rules change; check the source before acting.
