OPEN-SOURCE SCRIPT
已更新 Histo-Patterns

Detect historical price patterns in real time using Euclidean matching.
Concept
Ever looked at a chart and thought "this looks exactly like that setup from 2023"? Histo-Patterns formalizes that intuition. Anchor a historical bar range, and the indicator continuously scans incoming price action for structurally similar setups.
How to use it
- Spot a meaningful pattern in history.
- Paste its exact datetime into Start Date & Time.
- Set Pattern Length in days. Decimals accepted, 0.5 for 12h, 0.25 for 6h.
- Set Matching %, structures above this threshold trigger a signal.
- Set Min Waiting Bars to control spacing between detections. Equal to Pattern Length = no overlaps.
Tip: Shorter patterns fire more often; longer ones are rarer and more selective.
Under the Hood
Euclidean distance measures how geometrically close the current bar sequence is to your reference.
That distance is inverted and passed through a sigmoid to produce a clean 0–100% match score.
Honest Limitations
Only detects patterns after the reference start time, no lookback before it.
Degrades on noisy or low-liquidity instruments.
No time warping, patterns that unfold faster or slower than the reference score poorly.
Similarity ≠ prediction. It tells you structure repeats, not what happens next.
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, trading recommendations, or a guarantee of future results. Past performance does not predict future returns. You alone are responsible for your trading decisions. Always test thoroughly in a simulated environment before trading with real capital.
Concept
Ever looked at a chart and thought "this looks exactly like that setup from 2023"? Histo-Patterns formalizes that intuition. Anchor a historical bar range, and the indicator continuously scans incoming price action for structurally similar setups.
How to use it
- Spot a meaningful pattern in history.
- Paste its exact datetime into Start Date & Time.
- Set Pattern Length in days. Decimals accepted, 0.5 for 12h, 0.25 for 6h.
- Set Matching %, structures above this threshold trigger a signal.
- Set Min Waiting Bars to control spacing between detections. Equal to Pattern Length = no overlaps.
Tip: Shorter patterns fire more often; longer ones are rarer and more selective.
Under the Hood
Euclidean distance measures how geometrically close the current bar sequence is to your reference.
That distance is inverted and passed through a sigmoid to produce a clean 0–100% match score.
Honest Limitations
Only detects patterns after the reference start time, no lookback before it.
Degrades on noisy or low-liquidity instruments.
No time warping, patterns that unfold faster or slower than the reference score poorly.
Similarity ≠ prediction. It tells you structure repeats, not what happens next.
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, trading recommendations, or a guarantee of future results. Past performance does not predict future returns. You alone are responsible for your trading decisions. Always test thoroughly in a simulated environment before trading with real capital.
版本注释
- added Source input开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。