TradingView
loxx
5 Th08 2022 04:24

Fourier Extrapolator of Price [Loxx] 

Bitcoin / TetherUSBinance

Mô tả

Fourier Extrapolator of Price [Loxx] is a multi-harmonic (or multi-tone) trigonometric model of a price series xi, i=1..n, is given by:

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

Where:

  • xi - 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.

see here: A Fast Efficient Technique for the Estimation of Frequency , B. G. Quinn and J. M. Fernandes, Biometrika, Vol. 78, No. 3 (Sep., 1991), pp. 489-497 (9 pages) Published By: Oxford University Press

The indicator has the following input parameters:
  • src - input source
  • npast - number of past bars, to which trigonometric series is fitted;
  • nharm - total number of harmonics in model;
  • frqtol - tolerance of frequency calculations.


The indicator plots the modeled past values

The purpose of this indicator is to showcase the Fourier Extrapolator method to be used in future indicators. While this method can also prediction future price movements, for our purpose here we will avoid doing.

Phát hành các Ghi chú

Fixed input names
Bình luận
bryantpan7
Hi loxx, it is a great indicator, just a quick question, does it repait?
Holidaya35
Love your work! Keep making great scripts
MasBart
Thank you.
Thêm nữa