Indicators: Price prediction by Nearest Neighbor found by a weighted correlation coefficient - page 2

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There is a warning. Could you please help me? Thank you in advance.
To the author, kudos!
Everything is written intelligently and compactly. Thank you.
There are wishes for improvement, if you are still doing it.
1. On the history it is necessary to draw not a neighbour, but the last point of the forecast, shifted back by its length (Nfut). I.e. calculate and draw the forecast for some interval in the past. Then the quality of the prediction will be obvious. However, the indicator will take a long time to think at startup.....
2. One neighbour is very little! The result is unstable.
Theoretically, it is necessary to take the number of neighbours = 3 lengths of the starting vector (i.e. pattern), and then average all forecasts (and better, with weights proportional to correlation coefficients).
Hey Vladimir,
I wanted to talk to you about this indicator for a customisation job.
Contact me if you can: najnudel@gmail.com.
tks
I have an improved nearest neighbour algorithm that I use for my purposes. It overcomes the mentioned drawbacks. The idea is simple. When searching for the nearest neighbour in historical patterns, store all past patterns, their known future patterns and the correlation coefficients between these past patterns and the present pattern. Let us call these correlation coefficients r, which is the vector of all past correlations. Instead of selecting the past pattern with the highest abs (r) as the nearest neighbour, use ALL past patterns as "nearest neighbours" but with their contributions weighted exp(sw*abs(r)), where sw is a user-selected exponent that controls the selectivity of predicting past patterns with the highest correlation coefficients. A very large sw value will cause the prediction to be influenced only by the neighbour with the strongest correlation (the true "nearest neighbour"). A very small sw will make all past patterns equally important. Those who understand the idea can rewrite the above code and publish a new indicator. Below is the implementation in Matlab. If you need to include only past patterns with positive correlation, remove the abs () function in r = abs (...). Then past patterns with negative correlation will automatically have the lowest weight.
Vladimir, I understand the idea.
But it will still be a random prediction.
Experimented a lot with finding patterns about 10 years ago. With mirroring, inversion, summation of paterns. Conclusion - complete randomness in continuing a paternus into the future. All coincidences are random.
Vladimir, I get the idea.
But it will still be a random prediction.
Experimented a lot with paternos search about 10 years ago. With mirroring, inversion, summation of paterns. Conclusion - complete randomness in continuing a paternus into the future. All coincidences are random.
I agree
Vladimir, I get the idea.
But it will still be a random prediction.
Experimented a lot with paternos search about 10 years ago. With mirroring, inversion, summation of paterns. Conclusion - complete randomness in continuing a paternus into the future. All coincidences are random.
if you consider real time, not at all. Similar movements at similar moments. You take the time factor out of the system and you get randomness.
I think the correct rate is somewhat 50:50, but the predicted results are useful for manual trading.
this code needs slight improvements but okayjustask your idea does make sense