DTW vs Pearson: Which Algorithm Finds Better Bitcoin Patterns?
DTW vs Pearson: how each measures Bitcoin price similarity, when each algorithm wins, and why the Ensemble combination often outperforms both.
When you run historical pattern matching on Bitcoin, the algorithm you choose fundamentally changes which historical instances you retrieve — and therefore what prediction you get. DTW (Dynamic Time Warping) and Pearson correlation are the two most widely used algorithms for financial time series similarity, and they measure similarity in genuinely different ways. Understanding the difference changes how you use the Pattern Finder and how much confidence to assign to any given result.
How Dynamic Time Warping (DTW) Works for Bitcoin
DTW finds the best-fit alignment between two price sequences by allowing one to be elastically stretched or compressed — making it ideal for Bitcoin patterns that form at variable speeds across different market regimes.
DTW measures the similarity between two price sequences by finding the optimal alignment between them — allowing one sequence to be "stretched" or "compressed" in time to best match the other.
Imagine a Bitcoin bull flag that took 30 candles to form in the current setup. DTW can match it against a historical bull flag that took 45 candles, by aligning the structural features (the entry to the flag, the consolidation, the tightening near the apex) rather than requiring that candle 15 in one sequence correspond to candle 15 in the other.
The practical result: DTW finds historical instances that look similar in shape even when the timing of individual moves was different. This is extremely useful for Bitcoin because:
- The same patterns take different amounts of time to form across different market regimes
- Bitcoin consolidations in low-volatility periods compress into fewer candles than in high-volatility ones
- The rate of price movement varies significantly between bull and bear market conditions
How Pearson Correlation Works for Bitcoin
Pearson correlation requires exact candle-by-candle alignment, producing high-precision matches when timing is critical but missing shape-similar patterns that formed at different speeds.
Pearson correlation measures the linear relationship between two sequences with exact temporal alignment — candle 1 must correspond to candle 1, candle 10 to candle 10. It asks: do these two sequences move in the same direction, at the same relative time, consistently throughout?
A Pearson score of +1.0 means the two sequences are perfectly correlated — every up-candle corresponds to an up-candle, every down-candle to a down-candle, at exactly the same times. A score of -1.0 means they are perfectly inversely correlated. A score near 0 means no meaningful linear relationship.
Because Pearson requires exact temporal alignment, it is more restrictive than DTW. It will miss historical instances where the pattern took a different number of candles to form but is otherwise highly similar. However, when it does find high-Pearson matches, the directional timing is highly precise — the matches lined up almost exactly.
When DTW Wins Over Pearson
DTW's elastic time alignment gives it a decisive advantage when patterns form at different speeds or market regimes have shifted between the current period and historical analogs.
DTW is the superior algorithm when:
- The current Bitcoin pattern might have formed in different timeframes in historical occurrences
- You want the broadest possible set of similar patterns and are willing to trade some timing precision for more matches
- The market regime (volatility, trend speed) has changed between the current period and historical periods you want to match against
- You are analyzing longer-term patterns (daily, weekly) where temporal alignment is inherently less precise
When Pearson Wins Over DTW
Pearson's strict temporal alignment makes it the right choice when exact candle-level timing matters more than shape flexibility.
Pearson is the superior algorithm when:
- The timing of specific candles within the pattern matters — for example, you want to find historical instances where a specific day of the week or a specific event-driven candle aligns exactly
- You are analyzing shorter-term patterns (5m, 15m) where the temporal compression/stretching that DTW allows would reduce relevance
- You specifically want high-precision matches with the same exact sequence of ups and downs, not just the same overall shape
When Ensemble Beats Both
The Ensemble algorithm combines the strengths of multiple measures into a single balanced score — the recommended starting point for most Bitcoin pattern searches because it avoids the blind spots of any single algorithm.
The Ensemble algorithm in the Pattern Finder combines multiple similarity measures — including shape distance, directional alignment, and temporal correlation — into a single weighted composite score. This means it does not optimize for any single dimension of similarity but produces matches that are broadly similar across multiple dimensions simultaneously.
Ensemble beats both DTW and Pearson individually when:
- You do not know in advance which dimension of similarity (shape, timing, direction) is most important for the current setup
- You want the most generally "similar" historical instances rather than the best matches on one specific measure
- You are starting a new analysis and want to explore the historical landscape before committing to a specific algorithm
The practical Bitcoin workflow: start with Ensemble to get a broad view, then switch to DTW if you want more shape-based matches with temporal flexibility, then validate with OBV matching to confirm that the volume flow also resembled the current period in the historical matches. Agreement across all three gives the strongest signal.
OBV Matching: The Underutilized Tool for Bitcoin
OBV-based matching adds a critical second dimension to pattern validation — confirming that not just the price shape but also the volume flow resembles the historical instances that preceded strong directional moves.
Bitcoin is particularly well-suited to OBV-based matching because institutional volume flows are a primary driver of BTC price — and they leave distinctive fingerprints in OBV data. When institutional buyers are accumulating, OBV rises even as price consolidates. When they are distributing, OBV falls even as price stays elevated.
Running OBV-based pattern matching alongside price-based matching provides a two-dimensional confirmation: the price shape and the volume flow both resemble the historical instances. This combined signal has historically preceded the strongest directional moves. Use the Live Scanner alongside the Pattern Finder to build a complete picture from both real-time detection and historical validation.
Key Takeaways
- DTW allows elastic time alignment — it matches patterns that took different numbers of candles to form
- Pearson requires exact temporal alignment — higher precision when the timing of each candle matters
- For most Bitcoin pattern analysis, DTW finds more useful matches because BTC patterns form at variable speeds
- Ensemble combines multiple measures into a balanced composite — the recommended starting algorithm
- OBV matching is the key confirmation layer: institutional accumulation leaves distinctive volume fingerprints
- Workflow: start with Ensemble → validate with OBV → run DTW for additional shape-based matches
Frequently Asked Questions
What is Dynamic Time Warping (DTW) for Bitcoin analysis?
Dynamic Time Warping (DTW) is a time series similarity algorithm that allows elastic time alignment — matching price sequences that have the same overall shape but took different numbers of candles to form. For Bitcoin analysis, DTW is valuable because the same chart patterns (bull flags, wedges, triangles) take different amounts of time to form across different market regimes. DTW finds the historical instances that most closely resemble the current pattern's shape, even if the historical instance was faster or slower than the current formation.
What is Pearson correlation for pattern matching?
Pearson correlation measures the linear relationship between two price sequences with exact temporal alignment — candle 1 must correspond to candle 1, candle 10 to candle 10. It produces a correlation coefficient between -1 and +1, where values near +1 indicate that the two sequences moved in the same direction at the same time consistently. Pearson is more restrictive than DTW (it requires exact timing) but produces higher-precision matches when it does find similarity — the directional timing is highly accurate.
Which is better for Bitcoin patterns: DTW or Pearson?
Neither algorithm is universally better — they answer different questions. DTW is better when you want broad shape-based matching with temporal flexibility (the same pattern that took different numbers of candles to form historically). Pearson is better when the exact timing of moves matters and you want the highest-precision temporal alignment. For most Bitcoin pattern analysis, DTW finds more useful matches because Bitcoin's patterns take variable amounts of time to form across different market conditions. Use both and compare the results — agreement between DTW and Pearson top matches is a strong confirmation signal.
What is the Ensemble algorithm in LetsDoCrypto?
The Ensemble algorithm in LetsDoCrypto's Pattern Finder combines multiple similarity measures — including shape distance, directional alignment, and temporal correlation — into a single weighted composite score. Instead of optimizing for one dimension of similarity, Ensemble produces matches that are broadly similar across multiple dimensions simultaneously. It is the recommended starting algorithm for most Bitcoin pattern searches because it avoids the blind spots of any individual algorithm and provides the most balanced overall view of historical similarity.
When should I use OBV pattern matching instead of DTW?
Use OBV pattern matching as a confirmation tool alongside DTW or Ensemble, not as a replacement. OBV matching finds historical periods where the volume flow pattern — how cumulative volume was building or declining — most closely resembles the current OBV shape. This is particularly valuable for Bitcoin because institutional accumulation creates distinctive OBV signatures (rising OBV while price consolidates). When OBV matches show the same subsequent price behavior as price-based matches, the convergent signal has significantly higher reliability.
Try it yourself
Everything described in this article is available free on LetsDoCrypto — no sign-up required.