Price prediction by Nearest Neighbor – indicator MetaTrader 5

Price prediction by Nearest Neighbour
The k-Nearest Neighbor algorithm (k-NN) searches for k past patterns (neighbors) that are most similar to the current pattern and computes the future prices based on weighted voting of those neighbors. The present indicator finds only one nearest neighbor. So, in essence, it is a 1-NN algorithm. It uses the Pearson correlation coefficient between the … Read more

Price prediction by Nearest Neighbor found by a weighted correlation coefficient – indicator MetaTrader 5

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 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 … Read more