Machine Learning RSI ║ BullVision
Apr 12, 2025

The Machine Learning RSI ║ BullVision indicator integrates K-Nearest Neighbors (KNN) machine learning with the classic Relative Strength Index to identify historical patterns and adapt momentum readings in real-time. By comparing current market conditions to similar past environments, the tool provides a dynamically weighted RSI output that enhances responsiveness and contextual awareness.
Usage
The Usage section describes how the script can be used to refine traditional momentum analysis. Traders can utilize the KNN engine to adjust RSI sensitivity based on historical similarity, making it suitable for various market regimes.
- Pattern Matching: The script compares current RSI and price action to historical bars. If a similar pattern is identified, the RSI value is weighted toward the historical outcome.
- Trend and Impulse Trading: Users can select between "Trend Following" or "Impulse" coloring modes to visualize market transitions.
- Filtering Noise: In high-volatility environments, users can apply advanced smoothing (like the Kalman Filter) to reduce false signals and clarify the primary momentum direction.
- Multi-Feature Analysis: Traders can increase the "Number of Features" (up to 5) to include volatility, slope, and price momentum in the machine learning calculation for more robust pattern recognition.
Details
The indicator functions by calculating a standard RSI and then refining it through a KNN (K-Nearest Neighbors) algorithm. At each candle, the script extracts normalized features (e.g., RSI level, momentum, volatility) to create a multi-dimensional data point. It then searches the historical lookback period for the "K" most similar points using Euclidean distance.
The final output is a blend between the standard RSI and the ML-enhanced RSI, controlled by the "ML Weight" parameter. This approach allows the indicator to "remember" how the RSI behaved in similar past conditions, effectively providing a statistically-backed adjustment to the current momentum reading.
Settings
RSI Base Settings
- RSI Length: Sets the lookback period for the base Relative Strength Index calculation.
- Apply Moving Average: Enables initial smoothing of the RSI line.
- MA Type: Selects the smoothing algorithm (e.g., SMA, EMA, ALMA, HMA, LSMA).
- MA Length: Determines the period of the selected moving average.
KNN Machine Learning
- Enable KNN Machine Learning: Toggles the ML enhancement engine on or off.
- K - Number of Neighbors: The number of historical similar matches used to calculate the ML adjustment.
- Historical Period for KNN: The depth of history the algorithm searches for pattern matches.
- ML Weight vs Standard RSI: Blends the machine learning output with the standard RSI (0.0 = Standard, 1.0 = Pure ML).
- Number of Features: The number of data points (RSI, Volatility, Slope, etc.) used to define a "similar" market condition.
Advanced Filtering
- Apply Additional Smoothing: Enables a secondary filter layer for the final output.
- Smoothing Method: Choice of advanced filters including Kalman, Double EMA, or ALMA.
- Smoothing Parameter: Adjusts the intensity of the filtering effect.
Visual Settings
- Neon Effect: Toggles high-contrast, vibrant color styling.
- Color Palette: Offers presets for Classic, Monochrome, and various color vision deficiencies (Deuteranopia, Protanopia, Tritanopia).
- Coloring Mode: Determines if the line color is based on trend direction or momentum impulses.
FAQ
How does the KNN engine improve the RSI? It identifies historical moments where the market structure looked similar to the present and uses the RSI behavior from those periods to adjust the current reading, providing context that a standard RSI lacks.
What features are used for similarity matching? Depending on the settings, it uses RSI level, RSI momentum, volatility, linear regression slope, and price momentum.
How can I access this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.