KNN Supertrend Horizon

Mar 23, 2026

Static chart image
Signals
Machine Learning
Trailing-Stop
Works on the following platforms:
tradingviewSymbolTradingView
For free use on the TradingView platform
ninjatraderNinjaTrader
For free use on the NinjaTrader platform
metatrader4MetaTrader 4/5
For free use on the MetaTrader 4/5 platform
thinkorswimThinkorswim
For free use on the Thinkorswim platform

The KNN Supertrend Horizon indicator is a machine learning trading indicator built to help traders identify trend direction, trend strength, and high-interest rejection areas on the chart. By combining K-Nearest Neighbors (KNN) classification with Supertrend logic, it transforms traditional trend-following analysis into a smarter, more adaptive trading strategy. The result is a clearer view of bullish and bearish market conditions, stronger confirmation for trend trades, and visual rejection signals that can help traders time entries, exits, and risk management more effectively.

How to Trade the KNN Supertrend Horizon Indicator

The KNN Supertrend Horizon indicator is designed to do more than a standard Supertrend. Instead of relying only on ATR-based trend shifts, it applies a machine learning model to evaluate whether the current market environment resembles past bullish or bearish conditions. This makes it useful for traders who want a trend indicator, machine learning indicator, and price action confirmation tool in one script.

At its core, the indicator helps traders stay aligned with the dominant move while also highlighting points where price may be rejecting a key trend level. This makes it suitable for trend-following strategies, pullback entries, and momentum confirmation.

Trend Direction and Market Bias

The main trend signal comes from the interaction between the KNN engine and the Supertrend baseline. The machine learning model studies RSI and ATR-related volatility across a historical search window, then classifies the most likely trend state based on similar past market behavior.

When the machine learning output agrees with the Supertrend direction, the indicator displays a colored horizon on the chart. This gives traders a fast way to read bias:

  • A bullish horizon suggests buyers are in control and price is trading in a higher-probability uptrend environment.
  • A bearish horizon suggests sellers are in control and price is trading in a higher-probability downtrend environment.
  • A weaker or less convincing visual state can suggest trend fatigue, indecision, or a market entering consolidation.

This structure makes the tool useful as both a trend confirmation indicator and a market regime filter.

3D Rejection Orbs for Entry and Exit Clues

One of the standout features of this trading indicator is the 3D Rejection Orbs, which appear when price reacts sharply around the Supertrend level and leaves behind a meaningful wick. These signals are designed to highlight moments where the market appears to reject continuation in one direction and respond strongly at the trend baseline.

  • The size of each orb changes dynamically based on relative volume.
  • A label attached to the orb displays the exact volume of the rejection candle.
  • These signals can help traders spot potential pullback entries, defensive exits, or local exhaustion areas.

In bullish conditions, traders may interpret rejection orbs near support as signs that buyers are stepping back in. In bearish conditions, rejection orbs near resistance can suggest renewed selling pressure. While these signals are not meant to be used in isolation, they can be powerful when combined with broader trend direction and market structure.

Confidence-Based Candle Coloring

The indicator also includes Liquid Smooth gradient candle coloring to visualize machine learning confidence. This is more than cosmetic. It provides an immediate read on whether the current trend has strong conviction or is beginning to lose momentum.

  • Brighter and more vibrant colors suggest stronger confidence from the ML engine.
  • More muted tones can indicate weakening momentum or a lower-confidence trend phase.
  • Smooth transitions help traders avoid overreacting to small shifts in market noise.

This feature can be especially helpful for traders who want a more intuitive read on whether a trend still has strength behind it.

Why This Machine Learning Trading Indicator Stands Out

Unlike a standard Supertrend indicator, the KNN Supertrend Horizon uses historical pattern recognition to filter trend signals. Traditional indicators can react too quickly in choppy conditions or lag during important transitions. By adding a KNN classifier, this script attempts to distinguish between meaningful directional moves and weaker, lower-quality fluctuations.

That makes it valuable for traders looking for:

  • A machine learning trading strategy framework
  • A trend-following indicator with added intelligence
  • A tool for combining volatility analysis, RSI behavior, and price rejection signals
  • A visual system for reading trend strength, market bias, and possible reversal reactions

How the KNN Supertrend Horizon Works

The machine learning component scans the current market using RSI and ATR-based volatility as its main features. It then compares the current state to previous bars inside the selected Search Window and finds the closest historical matches using the chosen number of K-Neighbors.

From there, the indicator estimates whether current conditions more closely resemble prior bullish or bearish setups. This output is then filtered through a confidence buffer so that only stronger directional probabilities are allowed to influence the trend state.

By requiring both machine learning confirmation and Supertrend alignment, the indicator reduces weak flips and improves the readability of the chart. In practice, this can help traders avoid some of the noise that often affects standalone trend indicators.

Key Features Traders Can Use

Machine Learning Trend Classification

The KNN engine brings adaptive behavior to the script by evaluating whether the present setup resembles bullish or bearish conditions from the past. This adds a statistical layer to trend analysis and can improve decision-making when markets are not moving cleanly.

Supertrend-Based Structure

The Supertrend component acts as the structural backbone of the indicator. It creates the trend baseline that price interacts with and helps define where rejection signals and directional alignment matter most.

Volume-Aware Rejection Signals

The 3D Rejection Orbs are designed to call attention to candles that show strong rejection behavior near the trend level. Since orb size is tied to relative volume, higher-interest reactions stand out more clearly on the chart.

Confidence Gradients

The smooth candle and horizon gradients help traders judge the strength of the current move at a glance. This can be useful for managing trades, avoiding low-conviction environments, and reading the quality of a breakout or pullback.

Real-Time Dashboard

The built-in dashboard gives traders a compact summary of the current market state, including direction, machine learning confidence, and relative volatility. This is useful for fast chart analysis and for confirming whether a setup matches the broader environment.

KNN Supertrend Horizon Indicator Settings Explained

SETTINGS

Machine Learning Settings

  • K-Neighbors: Sets how many historical neighbors the KNN algorithm uses to classify the current trend direction. Lower values can make the model more reactive, while higher values may smooth the output and focus on broader similarity.
  • Search Window: Defines how many past bars are scanned to find similar historical conditions. A larger search window provides more pattern history, while a smaller one focuses the model on more recent behavior.

Supertrend Settings

  • ATR Length: Controls the lookback period for the Average True Range calculation. This affects how the Supertrend adapts to market volatility.
  • Factor: Sets the ATR multiplier used to place the Supertrend line above or below price. Higher values generally create a wider, slower trend baseline, while lower values make it more responsive.

Noise Filter Settings

  • Smooth Price Input: Applies HMA smoothing to the price source used in the machine learning features. This can reduce market noise and create cleaner classifications.
  • ML Confidence Buffer (%): Defines how far above or below the midpoint probability the ML signal must move before a trend change is accepted. This is useful for preventing choppy signal flips.

Rejection Signal Settings

  • Show 3D Rejection Orbs: Turns the volume-based rejection bubbles on or off.
  • Min Wick-to-Body Multiplier: Sets the minimum wick-to-body ratio required for a candle to qualify as a rejection signal.
  • Min Bubble Gap: Defines the minimum spacing in bars between consecutive rejection orb signals, helping reduce clutter.

Visual & Dashboard Settings

  • Liquid Smoothness: Controls the EMA smoothing applied to machine learning confidence for the candle and horizon gradients.
  • Vibrancy: Adjusts the intensity of the visual gradients for traders who want more or less pronounced coloring.
  • Show Dashboard: Toggles the on-chart statistics panel showing trend direction, ML confidence, and relative volatility.

Best Ways to Use This Trading Strategy Indicator

The KNN Supertrend Horizon can be used in several ways depending on your style:

Trend-Following Confirmation

Traders can use the horizon direction and confidence coloring to confirm whether a trend is strong enough to trade. This is especially useful for filtering breakout trades or staying in trend positions longer.

Pullback Entries

When price pulls back toward the Supertrend level and forms a rejection orb, traders may use that area as a potential continuation setup. This approach can be effective when the broader trend remains intact and the machine learning confidence stays supportive.

Trade Management

The gradient candle colors can help traders gauge whether trend conviction is strengthening or fading. This can support decisions around holding, scaling out, or tightening stops.

Sideways Market Filtering

Because the machine learning confidence can weaken in indecisive conditions, the indicator can also help traders avoid low-quality environments where standard trend indicators often get chopped up.

FAQ

What is the KNN Supertrend Horizon indicator?

The KNN Supertrend Horizon is a machine learning trading indicator that combines K-Nearest Neighbors classification, Supertrend logic, RSI, and ATR-based volatility to identify likely trend direction, confidence, and price rejection zones.

Is KNN Supertrend Horizon a trend indicator or a trading strategy?

It can be used as both. At its core, it is a trend indicator, but many traders can build a full trading strategy around it by combining trend direction, rejection orb signals, and confidence gradients with their own entry and risk rules.

What are the 3D Rejection Orbs used for?

The 3D Rejection Orbs highlight candles that reject the Supertrend area with meaningful wick structure and relative volume. Traders can use them as potential clues for pullback entries, exits, or exhaustion points.

Who is this indicator best for?

This trading indicator can be useful for trend traders, swing traders, and active chart users who want more than a basic Supertrend. It is especially appealing to traders interested in machine learning indicators, trend strength analysis, and volume-based rejection signals.

How do I access KNN Supertrend Horizon?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.comTradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, CoinAPI. CBOE BZX real-time US equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.