How we find similar situations in chart history

Updated 2026-09-25 Читать по-русски

Most tools that claim to "find patterns" never say what they compare, how closely, or what they throw away. This page does. Below is the actual pipeline running on Scan Chart, with the thresholds it uses and what each one costs you.

The job: take the most recent stretch of a chart and find every place in that instrument's history where price moved in a similar way. Then look at what happened after each one.

The sample window

You compare a stretch against a stretch. The stretch you are searching for is the sample, and its length is the first decision.

We offer 20, 50, 60 and 100 candles; the default is 50. Both ends of that range fail in predictable ways. At 20 candles the shape carries too little information — almost any 20-bar move has happened before, so matches are plentiful and meaningless. At 100 the shape is so specific that exact analogues may not exist at all.

Length also silently sets the timescale. Fifty four-hour candles is roughly eight days. Fifty daily candles is two and a half months. The same slider means very different things on different timeframes.

Slicing the history

The instrument's history is then cut into every possible window of that length: candles 1–50, 2–51, and so on. For BTC/USDT on the four-hour chart that is about twenty thousand windows.

Each one is a candidate. The problem reduces to scoring all of them and keeping those above a threshold.

Normalisation: shape, not price

Compare raw prices and Bitcoin at 20,000 will never resemble Bitcoin at 90,000, however identical the movement. Absolute levels carry no information about shape.

So every window is converted to percentage change from its own first candle. A window that ran 20,000 → 21,000 and a window that ran 90,000 → 94,500 look identical afterwards: plus five percent from the start. We compare the trajectory, not the price tag.

That choice has a cost, and we pay it two steps down.

The cheap pre-filter

Twenty thousand candidates is a lot if each one goes through an expensive algorithm. So the first pass is deliberately cheap: a Pearson correlation between the sample and the window, computed vectorised in batches of two thousand.

The cut-off is 0.70 for price-based methods and 0.50 for methods that work on bar-to-bar changes — those series are noisier, and a strict threshold there would discard usable matches.

Pearson is crude. It compares points strictly by position and does not forgive a shift in time. As a first pass that is exactly what we want: anything failing even 0.70 will not survive the shape comparison either. Only a minority of candidates reaches the expensive stage. Why the crude measure cannot replace the precise one is covered in the DTW comparison.

The amplitude gate

Here the cost of normalisation comes due. The main algorithm is scale-invariant: a one-percent drift and a twenty-three-percent collapse with the same outline score as similar, because after normalisation they genuinely are similar in shape.

That is useless in practice. A quiet drift and a crash are different events, and studying the aftermath of one to understand the other is a mistake.

So a separate gate compares total movement: the window's change from first to last candle must be within ten percent, relatively, of the sample's total. For samples that end almost flat there is an absolute floor of half a percentage point, otherwise a relative tolerance collapses to nothing.

The similarity threshold

Similarity is expressed as a percentage: 100 is identical, downward from there. The slider runs 70 to 90 in steps of 10, and starts at 80.

The steps are far less even than the scale suggests. Measured on BTC/USDT, four-hour chart, sample window 17–25 September 2026, price-based comparison:

Threshold Matches Up Down
90 0 — —
80 28 16 12
70 53 28 25

Ninety demands a near-exact shape match and frequently returns nothing on a live window. Seventy returns fifty-odd analogues, but "similar" has become generous by then.

The practical consequence is worth stating bluntly: the lower the threshold, the easier it is to find support for whatever you already believe. Drop the slider until the picture looks convincing and you have learned something about your filtering, not about the market.

Non-overlapping matches

Adjacent windows differ by one candle and resemble each other almost as much as they resemble the sample. Keep them all and a dozen genuinely distinct episodes become a hundred rows, with any statistic counting the same event over and over.

So each cluster of overlapping windows contributes one entry, the best of them. The twenty-eight matches above are twenty-eight different places in history, not twenty-eight shifts of the same one.

What you actually get

Five filters: window length, shape normalisation, a cheap correlation pass, an amplitude gate, and the similarity threshold. Each is tunable and each changes the answer.

The output is a list of places where price moved in a comparable way, plus a picture of what followed each. That is a description of the past. Computing the share of outcomes does not convert it into a forecast — what the statistics do and do not support is a separate discussion.

See it on a live chart

The same markup on a prepared example: the chart, the objects it found and what followed.

Open the example