All indicators

kNN Market Architecture

By LuxAlgoMar 16, 2026

Static chart image

kNN Market Architecture draws a three-layer map of market structure (short, medium, and long-term) and lets a k-nearest neighbors model decide which pivots earn a place on it. Each candidate pivot is described by features such as relative ATR and volume, compared with a record of historical pivots, and plotted only when its nearest neighbors clear the Confidence Threshold. The result is structure with the noise argued away statistically rather than filtered by eye.

How to Trade the kNN Market Architecture?

  • Bias by layer: pick ST, MT, or LT as the Bias Source. Above the layer's last validated high the read is bullish, below its last validated low bearish.
  • Breaks of structure: a validated level giving way signals continuation; keeping all three layers visible gives top-down alignment on one chart.
  • Delta Tank: labels at unbroken levels accumulate total volume, delta, and the delta-to-volume ratio. A filling green tank shows buyers active at the level, a red one warns it may break.
  • Anchored volume profile: spans the active range between the last validated high and low, exposing where volume concentrated inside the current structure.

With Auto-Adjust Sensitivity enabled, the detection window scales with an ATR ratio, expanding in hot volatility so only larger moves qualify, contracting in quiet tape.

kNN Market Architecture Settings

  • Structure Sensitivity: base lookback for pivot detection.
  • Auto-Adjust Sensitivity: volatility-based scaling of the detection window.
  • k-Nearest Neighbors: how many historical pivots each candidate is compared against.
  • Confidence Threshold: minimum similarity score a pivot needs to plot.
  • ST / MT / LT Toggles, Bias Source, and Color Candles by Bias: layer visibility, the bias driver, and gradient candle coloring.
  • Show Volume Profile, Profile Rows, and Profile Width (%): the anchored profile and its resolution.

Frequently Asked Questions

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5
Original indicatorBuilt in-house by LuxAlgo

The Library is free. Quant makes it yours.

Pull any concept or indicator into Quant: rebuild it, retune it, or turn it into a backtested strategy of your own.