Download MetaTrader 5

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

To add comments, please log in or register
Automated-Trading
Admin
100924
Automated-Trading 2010.07.12 11:50 

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

Price prediction by Nearest Neighbor found by a weighted correlation coefficient

erkan
24
erkan 2010.07.20 11:39  
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.
Vladimir
5932
Vladimir 2010.07.21 09:30  
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.
MathQuant
73
MathQuant 2013.01.20 16:11  

Thank You


To add comments, please log in or register