Guarda come scaricare robot di trading gratuitamente
Ci trovi su Telegram!
Unisciti alla nostra fan page
Script interessante?
Pubblica il link!
lasciare che altri lo valutino
Ti è piaciuto lo script? Provalo nel Terminale MetaTrader 5
Indicatori

Price prediction by Nearest Neighbor - indicatore per MetaTrader 5

Pubblicati da::
Vladimir
Visualizzazioni:
20022
Valutazioni:
(38)
Pubblicato:
2010.07.09 10:29
Aggiornato:
2016.11.22 07:32
Hai bisogno di un robot o indicatore basato su questo codice? Ordinalo su Freelance Vai a Freelance

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 current pattern and all past patterns as the measure of distance between them.

The indicator has the following input parameters:

  • Npast - number of past bars in a pattern;
  • Nfut -number of future bars in a pattern (must be < Npast).

The indicator plots two curves: the blue curve indicates the past prices of the nearest neighbour and the red curve indicates the future prices of the same pattern. The nearest neighbour 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. For example,

Nearest_Neighbor (EURUSD,H1): Nearest neighbor is dated 2003.08.26 23:00:00 and has correlation with current pattern of 0.9432442047577905;

Image:

Price prediction by Nearest Neighbour


iS7N_TREND_1 iS7N_TREND_1

Trend indicator with simple smoothing algorithms.

Fourier extrapolation of price Fourier extrapolation of price

This indicator fits a trigonometric model to prices and extrapolates it in the future.

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

This indicator finds the nearest neighbor by using a weighted correlation coefficient, in which more recent prices have larger weights. The weight decays linearly from newer to older prices within a price pattern.

BB 3sigma BB 3sigma

Bollinger Bands +-3sigma. You can change period and sigma ratio (Proper size of Deviation is 0.5~1.0)