{"slug":"search-modes","title":"Search modes: DTW and Geo","content":"# Search modes: DTW and Geo\n\nDejaBars ships eight matching algorithms. They fall into three families, and they differ in\nhow strictly they compare two price curves.\n\n## Geometric — the cheapest, and free\n\n**Geo** simplifies both your pattern and every candidate window into straight segments using\nRamer–Douglas–Peucker, then compares the angles, the ratios between segments and the direction of\neach turn.\n\n- Speed: fast.\n- Cost multiplier: 1 (free tier, with a free timeframe and a period up to 30 days).\n- Best for: clean, clearly-shaped patterns you drew deliberately.\n\n## Warping family — flexible shapes\n\n| Algorithm | What it does | Cost multiplier |\n|---|---|---|\n| **DTW** (Dynamic Time Warping) | Classic shape match that allows a curve to stretch and compress in time | 2 |\n| **WDTW** (Weighted DTW) | DTW with a penalty that grows with how far a point is warped | 6 |\n| **ERP** (Edit distance with Real Penalty) | Edit-distance style comparison that tolerates gaps | 6 |\n| **LCSS** (Longest Common Subsequence) | Matches the shared subsequence and ignores outliers | 6 |\n\nThese find shapes that appear at a different speed than you drew them, which is why they are the\nmost expensive to run.\n\n## Statistical family — exact, very fast\n\n| Algorithm | What it does | Cost multiplier |\n|---|---|---|\n| **Matrix Profile** | Finds every repeated subsequence of the same length across the series | 3 |\n| **Cross-Correlation** | Sliding-window Pearson correlation; finds near-exact copies of your template | 3 |\n| **SAX** | Symbolic aggregate approximation; compares coarse shape signatures | 3 |\n\nMatrix Profile and Cross-Correlation require the candidate window to match your pattern's length,\nso they are precise but rigid. SAX is a middle ground.\n\n## Which should I use?\n\n1. Start with **Geo**: instant, free, and it handles most hand-drawn shapes.\n2. If too little comes back, move to **DTW**: it tolerates different speeds.\n3. If you want exact repeats of a specific template, use **Cross-Correlation** or **Matrix Profile**.\n4. Reach for **WDTW / ERP / LCSS** when the shape matters but timing varies a lot — they cost the most.\n\n## Cost\n\nA search costs `timeframe × algorithm × period` tokens; the free tier (Geo, 1h–1w timeframe,\nperiod up to 30 days) is free. See [Tokens, plans and allowances](/docs/tokens-and-plans).\n","category":"guide","version":"896f3cae4531","updated_at":"2026-09-16T21:05:35.383124+02:00","is_published":true}