Skip to content
All library documents

Finding Similar Historical Price Patterns with Feature-Based Search

Article TradingView scripts

Summary

Sniffer is a chart indicator that searches a configurable historical lookback for periods resembling a user-selected bar sequence. It represents bars with price and volume attributes, with optional features such as candle-body and wick ratios, rate of change, RSI, CCI, stochastic, directional movement, ADX, and calendar fields. A user chooses a similarity measure, including Euclidean, cosine, Manhattan, Lorentzian, or Pearson distance, and the indicator highlights the top-ranked matches while filtering overlapping selections.

This is a visual analogue-search tool, not a predictive trading strategy: it ranks resemblance but does not define trade entries, exits, or expected returns. Results depend on the chosen time window, feature set, scaling, distance calculation, and overlap filter. The document supplies no out-of-sample evaluation or evidence that similar-looking past sequences lead to similar future outcomes. Its code also includes specialized distance implementations, so users should verify calculations before relying on rankings.

Key ideas

  • The indicator compares a selected bar sequence with historical windows in a configurable lookback.
  • Users can select raw price and volume attributes and add technical, candle-shape, or calendar features.
  • Several distance measures are offered to rank candidate matches.
  • An overlap filter reduces repeated or heavily overlapping highlighted periods.
  • Similarity rankings do not establish predictive power, and the document reports no validation results.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.