거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Facebook에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
지표

Price prediction by Nearest Neighbor found by a weighted correlation coefficient - MetaTrader 5용 지표

게시자:
Vladimir
조회수:
20798
평가:
(47)
게시됨:
2010.07.12 11:50
업데이트됨:
2016.11.22 07:32
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

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 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 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. For example,

2010.07.09 11:37:10 Nearest Neighbor - weighted corr (EURUSD,H1) Nearest neighbor starts on 2003.02.21 13:00:00 and ends on 2003.03.12 00:00:00. Its correlation coefficient with current pattern is 0.9521726745708775

Price prediction by Nearest Neighbor found by a weighted correlation coefficient


Price prediction by Nearest Neighbor Price prediction by Nearest Neighbor

This indicator uses the Nearest Neighbor clustering technique, also called k-NN, to search for the most similar pattern in history and use its past prices as predictions of the current pattern future prices.

iS7N_TREND_1 iS7N_TREND_1

Trend indicator with simple smoothing algorithms.

BB 3sigma BB 3sigma

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

iS7N_TREND.mq5 iS7N_TREND.mq5

Now it's two-color (or two-mode) trend indicator, the number of calculated bars can be specified.