PROTECTED SOURCE SCRIPT
X Adaptive Supertrend

a proprietary technical analysis tool designed to generate high-conviction trend signals by integrating an advanced, self-optimizing Supertrend methodology with two critical momentum and volume-based filters: the Daily Anchored AVWAP and a Multi-Timeframe KAMA (Kaufman's Adaptive Moving Average).
Unlike traditional trend indicators with fixed settings, this indicator dynamically adjusts its core sensitivity to the market's current volatility environment, ensuring that the Supertrend line minimizes whipsaws while maximizing responsiveness. The resulting signals are categorized into three distinct conviction levels (Full Power, Muted, and Upgrade) to help traders manage risk and filter low-probability entries.
Core Methodology: Stable Adaptive Supertrend
The core of the indicator relies on a sophisticated machine learning technique: K-Means Clustering.
Multi-Factor Calculation: The script runs 9 independent Supertrend instances concurrently, ranging in sensitivity (Factor) from 1.0 to 5.0 (in 0.5 increments) with a fixed ATR Length of 12.
Performance Clustering (Focus on Stability): Each Supertrend instance's profit/loss performance is recorded and analyzed. K-Means Clustering is used to group these instances based on how they performed over a long-term lookback period (Performance Memory EMA: 50). By using a longer memory, the indicator focuses on selecting the most resilient factor for structural, sustained trends, making the Supertrend line highly stable and less susceptible to short-term noise.
Optimal Factor Selection: The system automatically selects the best-performing factor from the cluster analysis, ensuring the Supertrend line shown on the chart is continually optimized for the prevailing market conditions. This delivers an adaptive trailing stop and trend detection mechanism focused on longer swings.
Multi-Layered Signal Filters
All signals are confirmed and graded using two powerful auxiliary filters, with the user designating the dominant (Primary) filter:
AVWAP
Tracks the Volume-Weighted Average Price, anchored to the start of the Exchange Day. Provides a strong, daily directional bias.
KAMA (AMA)
An adaptive moving average that dynamically adjusts its speed to the market's efficiency. Filters noise on lower timeframes.
Signal Structure and Use Case
The signal logic provides clarity on the strength and timing of potential trend entries or shifts:
Full Power (Initial Entry)
Trigger: The Adaptive Supertrend line flips (e.g., from bear to bull) AND both the Primary and Secondary Filter slopes agree with the new direction.
Muted Signal (Cautionary Entry)
Trigger: The Adaptive Supertrend flips, and the Primary Filter agrees, BUT the Secondary Filter is counter-trend (e.g., KAMA is still sloping down on a Bull flip).
Upgrade Signal (Confirmation In-Trend)
Trigger: The Supertrend is already established in a direction (e.g., Bullish), and the Secondary Filter (which was previously disagreeing) now flips its slope to agree.
Recommended Use Case
This indicator is uniquely powerful for traders operating across multiple time horizons. The inherent stability provided by the high performance memory (perfAlpha=50) successfully smooths the Supertrend line on both higher and lower timeframes (e.g., 1-minute charts), effectively filtering out nominal, high-frequency noise while retaining the integrity of larger price movements.
Unlike traditional trend indicators with fixed settings, this indicator dynamically adjusts its core sensitivity to the market's current volatility environment, ensuring that the Supertrend line minimizes whipsaws while maximizing responsiveness. The resulting signals are categorized into three distinct conviction levels (Full Power, Muted, and Upgrade) to help traders manage risk and filter low-probability entries.
Core Methodology: Stable Adaptive Supertrend
The core of the indicator relies on a sophisticated machine learning technique: K-Means Clustering.
Multi-Factor Calculation: The script runs 9 independent Supertrend instances concurrently, ranging in sensitivity (Factor) from 1.0 to 5.0 (in 0.5 increments) with a fixed ATR Length of 12.
Performance Clustering (Focus on Stability): Each Supertrend instance's profit/loss performance is recorded and analyzed. K-Means Clustering is used to group these instances based on how they performed over a long-term lookback period (Performance Memory EMA: 50). By using a longer memory, the indicator focuses on selecting the most resilient factor for structural, sustained trends, making the Supertrend line highly stable and less susceptible to short-term noise.
Optimal Factor Selection: The system automatically selects the best-performing factor from the cluster analysis, ensuring the Supertrend line shown on the chart is continually optimized for the prevailing market conditions. This delivers an adaptive trailing stop and trend detection mechanism focused on longer swings.
Multi-Layered Signal Filters
All signals are confirmed and graded using two powerful auxiliary filters, with the user designating the dominant (Primary) filter:
AVWAP
Tracks the Volume-Weighted Average Price, anchored to the start of the Exchange Day. Provides a strong, daily directional bias.
KAMA (AMA)
An adaptive moving average that dynamically adjusts its speed to the market's efficiency. Filters noise on lower timeframes.
Signal Structure and Use Case
The signal logic provides clarity on the strength and timing of potential trend entries or shifts:
Full Power (Initial Entry)
Trigger: The Adaptive Supertrend line flips (e.g., from bear to bull) AND both the Primary and Secondary Filter slopes agree with the new direction.
Muted Signal (Cautionary Entry)
Trigger: The Adaptive Supertrend flips, and the Primary Filter agrees, BUT the Secondary Filter is counter-trend (e.g., KAMA is still sloping down on a Bull flip).
Upgrade Signal (Confirmation In-Trend)
Trigger: The Supertrend is already established in a direction (e.g., Bullish), and the Secondary Filter (which was previously disagreeing) now flips its slope to agree.
Recommended Use Case
This indicator is uniquely powerful for traders operating across multiple time horizons. The inherent stability provided by the high performance memory (perfAlpha=50) successfully smooths the Supertrend line on both higher and lower timeframes (e.g., 1-minute charts), effectively filtering out nominal, high-frequency noise while retaining the integrity of larger price movements.
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用,没有任何限制 — 了解更多信息这里。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用,没有任何限制 — 了解更多信息这里。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。