RibboNN Machine Learning
Jul 24, 2023

The RibboNN Machine Learning indicator is a trend-following tool that utilizes a Nearest Neighbor algorithm to predict market direction and visualize it through an adaptive ribbon overlay. This script aims to provide traders with robust trend forecasts by analyzing historical data patterns to identify potential bullish or bearish market shifts.
Usage
The Usage section describes how the script can be used to identify market trends and potential entry points. The indicator displays a multi-layered ribbon on the price chart that changes color based on the machine learning model's prediction:
- Bullish Trend: When the model predicts an upward move, the ribbon turns green. This indicates a potential long bias or an environment suitable for trend-following buy positions.
- Bearish Trend: When the model predicts a downward move, the ribbon turns red. This indicates a potential short bias or an environment suitable for trend-following sell positions.
Traders can use the ribbon as a dynamic support or resistance zone during strong trends. The gradient and width of the ribbon provide visual feedback on the strength of the predicted trend.
Details
The script operates using a combination of conditional classification and a Nearest Neighbor (NN) algorithm:
- Conditional Classification: The model generates a base prediction by evaluating two sets of data (Fast and Slow periods) against specific sensitivity thresholds.
- Nearest Neighbor Algorithm: To refine these predictions, the script stores historical feature data and uses the Manhattan distance to find historical instances that resemble current market conditions. It then aggregates the outcomes of these "neighbors" to form a final prediction.
- Range-Weighted MA: The visual ribbon is constructed using a series of moving averages weighted by bar range, creating a smoother and more reactive visual than standard simple moving averages.
Settings
Core Settings
- Slow Period: Sets the lookback period for the primary long-term data calculation.
- Fast Period: Sets the lookback period for the primary short-term data calculation.
- Neighbours Count: Determines how many historical data points are analyzed to find patterns. Smaller values make the model more sensitive to local price action, while larger values provide smoother, more global trend analysis.
- Long Sensitivity: Adjusts the threshold for generating uptrend classification labels.
- Short Sensitivity: Adjusts the threshold for generating downtrend classification labels.
Visual Settings
- Bull: Customizable colors for the bullish ribbon gradient.
- Bear: Customizable colors for the bearish ribbon gradient.
FAQ
How do I interpret the ribbon color changes?
A change from red to green suggests the machine learning model has detected a shift toward an uptrend, while a change from green to red suggests a shift toward a downtrend.
What happens if I increase the Neighbours Count?
Increasing the Neighbours Count typically results in a smoother ribbon with fewer signals, as the algorithm requires more historical agreement to change its prediction.
How can I access RibboNN Machine Learning?
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.

