Automated-Trading:
I know some of your codes in MQL4 as well and you seem to have a firm grasp of some advanced subjects , very good work Vladimir.
Price prediction by Nearest Neighbor found by a weighted correlation coefficient:
Author: Vladimir
geordie:
I know some of your codes in MQL4 as well and you seem to have a firm grasp of some advanced subjects , very good work Vladimir.
Thanks for the kind words and encouragement.
I know some of your codes in MQL4 as well and you seem to have a firm grasp of some advanced subjects , very good work Vladimir.
Thank You
tolga gogebakan:
It is benign - continue using it as is since it does not influence the work of the indicator
There is a warning. Could you please help me? Thank you in advance.
Hi Vladimir, thanks a lot for your kindness of sharing your beautiful, awesome, amazing, and incredible futuristic and advanced thought and ideas. I'm your fan of coding this either mql4 or 5. Let's keep that way. As well appreciated much for McLaden help though short explanation but very useful. God bless you all.
I think the correct rate is somewhat 50:50, but the predicted results are useful for manual trading.
okayjustask #:
I think the correct rate is somewhat 50:50, but the predicted results are useful for manual trading.
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

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
Price prediction by Nearest Neighbor found by a weighted correlation coefficient:
The main disadvantage of the classical Nearest Neighbor algorithm (see an examplary implementation in https://www.mql5.com/en/code/133) is that all prices within a pattern are treated equally. In other words, it assumes that older prices have the same effect on future as newer ones.
To overcome this drawback, this version of the nearest neighbor indicator gives larger weights to most recent prices while searching for the closest pattern in the past. It uses a weighted correlation coefficient, whose weight decays linearly from newer to older prices within a price pattern.
The indicator plots two curves: the blue curve indicates the past prices of the nearest neighbor and the red curve indicates the future prices of the same pattern. The nearest neighbor is scaled according to the linear regression slope between this pattern and the current pattern. The indicator also prints the information about the starting date of the nearest neighbor and its correlation coefficient to the present pattern.
Author: Vladimir