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

Fourier extrapolation of price - MetaTrader 5용 지표

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

A multi-harmonic (or multi-tone) trigonometric model of a price series x[i], i=1..n, is given by:

x[i] = m + Sum( a[h]*Cos(w[h]*i) + b[h]*Sin(w[h]*i), h=1..H )

where:

  • x[i] - past price at i-th bar, total n past prices;
  • m - bias;
  • a[h] and b[h] - scaling coefficients of harmonics;
  • w[h] - frequency of a harmonic;
  • h - harmonic number;
  • H - total number of fitted harmonics.

Fitting this model means finding m, a[h], b[h], and w[h] that make the modeled values to be close to real values. Finding the harmonic frequencies w[h] is the most difficult part of fitting a trigonometric model. In the case of a Fourier series, these frequencies are set at 2*pi*h/n. But, the Fourier series extrapolation means simply repeating the n past prices into the future.

This indicator uses the Quinn-Fernandes algorithm to find the harmonic frequencies. It fits harmonics of the trigonometric series one by one until the specified total number of harmonics H is reached. After fitting a new harmonic, the coded algorithm computes the residue between the updated model and the real values and fits a new harmonic to the residue.

The indicator has the following input parameters:

  • Npast - number of past bars, to which trigonometric series is fitted;
  • Nfut - number of predicted future bars;
  • Nharm - total number of harmonics in model;
  • FreqTOL - tolerance of frequency calculations.

The indicator plots two curves: the blue curve indicates modeled past values and the red curve indicates the modeled future values.

Fourier extrapolation of price

AR extrapolation of price AR extrapolation of price

This indicator uses an autoregresive model to extrapolate prices

Linear regression slope Linear regression slope

Linear regression slope normalized to SMA.

iS7N_TREND_1 iS7N_TREND_1

Trend indicator with simple smoothing algorithms.

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.