PROTECTED SOURCE SCRIPT

Demo Indicator: AI Pattern Similarity Algorithm [Nexo Mechanics]

12
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
  • 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.

syot kilat
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.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.