OPEN-SOURCE SCRIPT
Cập nhật 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.
Phát hành các Ghi chú
- added Source inputMã 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.