Skip to content
All library documents

Using the Goertzel Algorithm to Detect Price Cycles

Article MQL5 articles

Summary

The article explains how the Goertzel algorithm computes selected discrete Fourier transform frequencies efficiently, making it an option when only a limited range of cycle periods is of interest. It describes a class that scans periods, returns real and imaginary components, and checks that the input series is long enough for the chosen maximum period. The discussion also notes the frequency resolution limits of a standard DFT and presents Goertzel as an alternative to maximum entropy spectral analysis, citing a research paper’s claim that it can perform better on noisy signals in some conditions.

The examples apply cycle analysis to financial price data and mention preprocessing, cycle-based indicators, and adaptive lookbacks. The article does not establish that detected cycles produce profitable trades. Its conclusion emphasizes that cycle duration and termination are difficult to predict, and that practical use depends on suitable preprocessing, market knowledge, risk controls, and ongoing adaptation. The implementation is described as resolving one frequency at a time, which limits its comparison with methods that assess a broader spectrum.

Key ideas

  • Goertzel computes selected DFT frequency components efficiently when only a limited set of periods is needed.
  • The implementation maps a range of cycle periods to real and imaginary output values.
  • Input length and selected period bounds constrain the cycles that can be analyzed.
  • The article presents noisy signals as a condition where Goertzel may compare favorably with MESA.
  • Detected financial cycles can change or end unpredictably, so they do not provide reliable timing on their own.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.