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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.