OPEN-SOURCE SCRIPT
Candle Pattern Finder

This indicator searches historical price data to find candle sequences that most closely resemble a recent pattern. It compares the shape of a configurable number of recent candles against hundreds of historical windows using z-score normalization; focuses on the shape of the move rather than price level. The three closest matches are identified and highlighted directly on the chart.
Once the matches are found, the indicator projects forward from each one, showing how price behaved in the bars that followed. The three individual paths are drawn in lighter lines, while a weighted consensus of all three is drawn prominently in orange. A percentage label at the end of the consensus line shows the projected move from the pattern's anchor price. Optionally, consensus can be disabled and only the closest matching pattern will be displayed.
A pattern offset control lets you shift the examined window back in time. With an offset of zero the indicator analyzes the most recent candles as normal. Increasing the offset slides the pattern window back by that many bars, with the projection lines shifting back to match — useful for visually checking what the indicator would have predicted at a specific point in the past and whether that prediction played out.
The indicator is fully configurable: pattern length, lookback depth, projection length, and all colors can be adjusted from the settings panel. Match regions are highlighted with shaded boxes so you can quickly locate in history where the matched patterns occurred.
This is just a tool that displays similarities, and should not be relied upon as an accurate prediction of future movement.
Once the matches are found, the indicator projects forward from each one, showing how price behaved in the bars that followed. The three individual paths are drawn in lighter lines, while a weighted consensus of all three is drawn prominently in orange. A percentage label at the end of the consensus line shows the projected move from the pattern's anchor price. Optionally, consensus can be disabled and only the closest matching pattern will be displayed.
A pattern offset control lets you shift the examined window back in time. With an offset of zero the indicator analyzes the most recent candles as normal. Increasing the offset slides the pattern window back by that many bars, with the projection lines shifting back to match — useful for visually checking what the indicator would have predicted at a specific point in the past and whether that prediction played out.
The indicator is fully configurable: pattern length, lookback depth, projection length, and all colors can be adjusted from the settings panel. Match regions are highlighted with shaded boxes so you can quickly locate in history where the matched patterns occurred.
This is just a tool that displays similarities, and should not be relied upon as an accurate prediction of future movement.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.