TradingView
loxx
10 авг 2022 г., 02:29

Real-Fast Fourier Transform of Price w/ Linear Regression [Loxx] 

U.S. Dollar/Canadian DollarFXCM

Описание

Real-Fast Fourier Transform of Price w/ Linear Regression [Loxx] is a indicator that implements a Real-Fast Fourier Transform on Price and modifies the output by a measure of Linear Regression. The solid line is the Linear Regression Trend of the windowed data, The green/red line is the Real FFT of price.

What is the Discrete Fourier Transform?
In mathematics, the discrete Fourier transform (DFT) converts a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples of the discrete-time Fourier transform (DTFT), which is a complex-valued function of frequency. The interval at which the DTFT is sampled is the reciprocal of the duration of the input sequence. An inverse DFT is a Fourier series, using the DTFT samples as coefficients of complex sinusoids at the corresponding DTFT frequencies. It has the same sample-values as the original input sequence. The DFT is therefore said to be a frequency domain representation of the original input sequence. If the original sequence spans all the non-zero values of a function, its DTFT is continuous (and periodic), and the DFT provides discrete samples of one cycle. If the original sequence is one cycle of a periodic function, the DFT provides all the non-zero values of one DTFT cycle.

What is the Complex Fast Fourier Transform?
The complex Fast Fourier Transform algorithm transforms N real or complex numbers into another N complex numbers. The complex FFT transforms a real or complex signal x[n] in the time domain into a complex two-sided spectrum X[n] in the frequency domain. You must remember that zero frequency corresponds to n = 0, positive frequencies 0 < f < f_c correspond to values 1 ≤ n ≤ N/2 −1, while negative frequencies −fc < f < 0 correspond to N/2 +1 ≤ n ≤ N −1. The value n = N/2 corresponds to both f = f_c and f = −f_c. f_c is the critical or Nyquist frequency with f_c = 1/(2*T) or half the sampling frequency. The first harmonic X[1] corresponds to the frequency 1/(N*T).
The complex FFT requires the list of values (resolution, or N) to be a power 2. If the input size if not a power of 2, then the input data will be padded with zeros to fit the size of the closest power of 2 upward.

What is Real-Fast Fourier Transform?
Has conditions similar to the complex Fast Fourier Transform value, except that the input data must be purely real. If the time series data has the basic type complex64, only the real parts of the complex numbers are used for the calculation. The imaginary parts are silently discarded.

Inputs:
  • src = source price
  • uselreg = whether you wish to modify output with linear regression calculation
  • Windowin = windowing period, restricted to powers of 2: "4", "8", "16", "32", "64", "128", "256", "512", "1024", "2048"
  • Treshold = to modified power output to fine tune signal
  • dtrendper = adjust regression calculation
  • barsback = move window backward from bar 0
  • mutebars = mute bar coloring for the range


Further reading:

Real-valued Fast Fourier Transform Algorithms IEEE Transactions on Acoustics, Speech, and Signal Processing, June 1987

Related indicators utilizing Fourier Transform

Fourier Extrapolator of Variety RSI w/ Bollinger Bands [Loxx]
tradingview.com/script/pHlxm005-Fourier-Extrapolator-of-Variety-RSI-w-Bollinger-Bands-Loxx/

Fourier Extrapolation of Variety Moving Averages [Loxx]
tradingview.com/script/u0r2gpti-Fourier-Extrapolator-of-Price-w-Projection-Forecast-Loxx/

Fourier Extrapolator of Price w/ Projection Forecast [Loxx]
tradingview.com/script/ffvTzAlA-Fourier-Extrapolation-of-Variety-Moving-Averages-Loxx/
Комментарии
aaahopper
I am not an advanced programmer or thinker :) but I wish to compliment you on many of the great scripts you have contributed on this platform.
I was wondering if you could clarify what you mean by "Output parameters: a " and how would you impliment it?
I think you may need a new title, "The Professor" :).
Thank you again and amazing work.
Jaivanth
Does this indicator repaint?
nochnoykefir
@Jaivanth, this doesn't matter because the indicator is absolutely useless, but it's interesting purely from a technical standpoint for a programmer.
Project_Money_Heist
I can't see these colours, I have astigmatism . Any option to customise colours on something more visible ? Blue bullish and red bearish for example. Thank U
Ещё