pofatoezil

Machine Learning: Radius Neighbors Regressor[Pofatoezil]

My native language is Chinese. The following introduction is translated using ChatGPT, and I hope the translation is fluent.

Introduction
This indicator is based on the machine learning model, Radius Neighbors Regressor, which predicts the target based on the similarity of past 500 input data. The provided indicator itself is merely a tool, requiring users to input features for comparison based on their preferences. In this indicator, you can utilize up to seven types of data for regression analysis and predict target values for up to three different time periods. It is essential for users to identify features suitable for their specific commodity on their own.

What is Radius Neighbor
The Radius Neighbors Regressor is a machine learning model used for regression tasks, specifically within the realm of supervised learning. It operates based on the principle of radius-based neighbor searches, where the algorithm predicts a target variable by considering the similarity of data points within a specified radius.

Unlike KNN, which considers a fixed number of nearest neighbors, Radius Neighbors Regressor allows for a flexible definition of neighborhoods by specifying a radius. This can be advantageous when dealing with varying densities in the dataset.

The radius-based approach may offer improved robustness in situations where the distribution of neighbors is not uniform or when dealing with outliers, as it considers all data points within the specified radius.

Parameter Settings and Output
Users need to import data(such as KD,RSI,ATR,CCI,MA,Volume....) from the TradingViewChart into the indicator first, and they can choose up to seven types. Then, they select the forecasting period and the regression target (such as Close, MA....). Afterward, set the maximum search radius, where the maximum value of the radius is the square root of N, where N is the number of features used. I recommend using 10% to 15% of the square root of N as the initial parameters.

Left Table
Neighbors: Indicates how many data points among the past 500 records are sufficiently close to the current data.
Ev: The target value predicted by the model.
WR: The probability of predicting a value greater than 0, noting that this is only meaningful for data values related to prices (Close, MA...).

Right Table
Distribution of predicted values for different periods. For example, 90% represents the predicted values at the 90th percentile among the past 500 data points. RK represents the real-time data ranking among past data, ranging from 0 to 100, where a higher number is more suitable for a long position, and vice versa for a short position.

example
I believe that this indicator has many suitable applications, but relying solely on it as a basis for trading decisions may pose risks. I'll leave it to you to explore.

DayChart
H1Chart
After Open Position
First, I observed on the DayChart that the indicator showed a neutral stance in the short, medium, and long term. Additionally, on the H1Chart, I noticed stronger bullish signals in the short, medium, and long-term data. Consequently, I decided to go long for an intraday position.
Protected script
This script is published closed-source but you may use it freely. You can favorite it to use it on a chart. You cannot view or modify its source code.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?