TradingView
loxx
10 aug 2022 04:04

Real-Fast Fourier Transform of Price Oscillator [Loxx] 

U.S. Dollar/Canadian DollarFXCM

Beskrivning

Real-Fast Fourier Transform Oscillator [Loxx] is a simple Real-Fast Fourier Transform Oscillator. You have the option to turn on inverse filter as well as min/max filters to fine tune the oscillator. This oscillator is normalized by default. This indicator is to demonstrate how one can easily turn the RFFT algorithm into an oscillator..

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 in the time domain into a complex two-sided spectrum X 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 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.

Included
  • Moving window from Last Bar setting. You can lock the oscillator in place on the current bar by adding 1 every time a new bar appears in the Last Bar Setting
Kommentarer
UnderdogR
why wouldn't tradingview team put this script writer to the wizard list, i really don't know. hundreds of scripts and at least 90% of them are super innovative. godspeed you sir. we as newbie pine learners are improving some thanks to you.
pal123123
Sir as you mentioned do we need to Add 1 onevery time last bar setting everytime?
bngoller
Hey, I’m wondering if you might be able to explain this indicator a little more. It seems really valuable in identifying the strength of a trend however I feel like I may be lacking an understanding of the values it generates.
bngoller
@bngoller, or put differently, which values would you suggest using in the 1h timeframe to assess trend direction/strength
OutsourcE
If there's an upper/lower limits for the thingy I'm wondering
Mer