PROTECTED SOURCE SCRIPT
Demo Indicator: AI Pattern Similarity Algorithm [Nexo Mechanics]

This is a demo indicator inspired by FAISS-style nearest-neighbour search. It performs a pattern similarity search to find historical windows whose return sequence most closely matches the most recent Pattern Length (L) window, then uses the average forward move after those matches to derive a directional bias with a p-value and confidence score.
Pattern Similarity

Prediction Signals
Visuals
Metrics
The indicator is intentionally limited and just for demo purposes. Nothing in this text or in the indicator constitutes financial advice.
Pattern Similarity
- At every confirmed bar, the script builds a query vector from the last Pattern Length (L) bars.
- It then scans backwards through a historical window (Dataset Size) and builds the same vector for every candidate offset.
- The algorithm keeps the Top-K closest matches.
Prediction Signals
- For each of the best matches, the script looks Prediction Horizon (H) bars ahead from that match.
- It computes the future move based on the average move of all matches.
- When the average move flips, a signal is generated (bearish flip or bullish flip).
- We decided to use a normal CDF for p-value approximation and approximate confidence using 1 - p.
- Confidence is used to filter between High Confidence predictions and other predictions.
Visuals
- When a high confidence prediction is triggered, a zone is drawn around the current query window.
- Zones are drawn around the Top-K matching windows found in history.
Metrics
- The table is meant to show only the most recent valid prediction’s metrics
- Best match (bars ago): how far back the closest match ends
- Predicted Move: Avg Move across Top-K (at horizon H)
- p-value / Confidence: statistical strength (heuristic; normal approx)
The indicator is intentionally limited and just for demo purposes. Nothing in this text or in the indicator constitutes financial advice.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 이를 자유롭게 제한 없이 사용할 수 있습니다 – 자세한 내용은 여기에서 확인하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.