AI SuperTrend x Pivot Percentile - Strategy
Jan 28, 2024

The AI SuperTrend x Pivot Percentile indicator is a strategy tool that integrates K-Nearest Neighbors (KNN) machine learning with traditional trend-following mechanics to enhance market entry accuracy. By combining AI-driven SuperTrend predictions with Pivot Percentile strength analysis, the tool identifies high-probability trend continuations while filtering out market noise.
Usage
The Usage section describes how the script can be used to identify market trends and execute trades based on synchronized signals.
The strategy generates signals based on the confluence of two primary components:
- Trend Identification: The AI-enhanced SuperTrend uses the KNN algorithm to classify the current market direction as bullish or bearish based on historical price behavior.
- Trend Strength Validation: The Pivot Percentile analysis evaluates the strength of the trend by calculating percentile ranks for highs and lows.
A Long signal is triggered when the AI SuperTrend indicates a bullish direction and the Pivot Percentile analysis confirms bullish strength. A Short signal is triggered when both components indicate a bearish direction and strength. Traders can utilize the dynamic trailing stop-loss, which is automatically adjusted based on the SuperTrend bands, to manage risk.
Details
The script's execution is built upon several advanced technical concepts:
- KNN Algorithm: Unlike standard SuperTrends that rely solely on current ATR and price, this script uses the K-Nearest Neighbors algorithm. It measures the "distance" between current data points and historical patterns to predict the most likely trend direction.
- Pivot Percentiles: This component calculates the rank of current prices relative to historical highs and lows over multiple time lengths. It serves as a secondary filter to ensure that signals are only generated when the price is showing significant momentum.
- Multi-TF Integration: The strategy allows for calculations based on higher timeframes (HTF), providing a macro perspective even when trading on lower timeframe charts.
- ADX/DMI Filter: To avoid "choppy" or sideways markets, the strategy includes an Average Directional Index (ADX) filter. This ensures trades are only taken when a trend is sufficiently strong.
Settings
The settings are categorized to allow for fine-tuning of the AI and technical components:
- Trade Setup
- Select Trading Direction: Choose between "Long", "Short", or "Both" to align with your bias.
- AI Settings
- Neighbors (K): The number of historical neighbors the KNN algorithm considers. Low values increase sensitivity; high values increase smoothness.
- Data Points: The total historical lookback period for the AI model.
- Super Trend Settings
- Higher Time Frame (1st & 2nd): The timeframes used for the dual SuperTrend calculation.
- Length: The lookback period for the ATR and Moving Average.
- Factor: The multiplier that determines the width of the SuperTrend bands.
- MA Source: The type of Moving Average used (SMA, EMA, WMA, RMA, VWMA).
- AI Trend Prediction
- Price/Prediction Trend: Lengths for the weighted moving averages used in AI classification.
- Pivot Percentile Settings
- Length for Pivot Percentile: The base lookback for calculating price percentiles.
- ADX and DMI Settings
- ADX Length: Lookback period for trend strength calculation.
- Time Frame for ADX: The timeframe used specifically for the strength filter.
- Use ADX and DMI Filter?: Toggles the requirement for a strong trend before entering trades.
FAQ
How do the AI settings affect the signals? Adjusting the "Neighbors" and "Data Points" determines how the KNN algorithm interprets history. A lower number of neighbors makes the strategy more responsive to recent volatility, while more data points provide a more stable, long-term trend outlook.
What is the purpose of the dual SuperTrend settings? The script uses two separate SuperTrend calculations (often on different timeframes) to ensure that entry signals are supported by both short-term momentum and long-term trend direction.
How do I access this tool? How to access AI SuperTrend x Pivot Percentile? 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.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. 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.

