OPEN-SOURCE SCRIPT
Pattern Similarity Projection

This indicator identifies historical price patterns that mathematically resemble recent market behavior to forecast potential future movements. It works by:
* **Scanning History:** Comparing the most recent price action (defaulting to the last 30 bars) against all available historical data using a Min-Max normalization and Mean Absolute Error algorithm.
* **Visualizing Matches:** Highlighting the top historical matches on the chart with similarity scores (e.g., "88.4% match").
* **Projecting Outcomes:** Drawing projection lines from the current price that mimic how those historical patterns played out.
* **Calculating Agreement:** analyzing the collective trajectory of all found matches to generate an "Agreement Score," indicating the consensus confidence of the projection.
The script is fully customizable, allowing users to select specific data points (Open, High, Low, Close, Volume) for comparison and adjust window sizes to fit different trading strategies.
* **Scanning History:** Comparing the most recent price action (defaulting to the last 30 bars) against all available historical data using a Min-Max normalization and Mean Absolute Error algorithm.
* **Visualizing Matches:** Highlighting the top historical matches on the chart with similarity scores (e.g., "88.4% match").
* **Projecting Outcomes:** Drawing projection lines from the current price that mimic how those historical patterns played out.
* **Calculating Agreement:** analyzing the collective trajectory of all found matches to generate an "Agreement Score," indicating the consensus confidence of the projection.
The script is fully customizable, allowing users to select specific data points (Open, High, Low, Close, Volume) for comparison and adjust window sizes to fit different trading strategies.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.