Skip to content
All library documents

Fourier Price Extrapolation with Sequential Harmonic Frequency Fitting

Article TradingView scripts

Summary

This indicator models a historical price window as a sum of sinusoidal components plus a bias, then extends the fitted components into a projected future path. Rather than fixing frequencies to the regular grid of a conventional Fourier series, it estimates them with the Quinn–Fernandes algorithm. It fits harmonics one at a time, updating the residual after each fit, and estimates each harmonic's coefficients through least squares.

Inputs control the price source, historical window, harmonic count, frequency tolerance, forecast horizon, and the point in the past from which to begin a projection. The chart distinguishes the fitted historical curve from its dotted forecast curve, and the retrospective start setting allows visual inspection of earlier projections. The document describes the construction and use as an illustration of extrapolation, but presents no forecast accuracy measurements or trading results. A harmonic fit to past prices alone does not establish that the oscillations will persist; results depend on window and model settings.

Key ideas

  • The model represents the observed price window as a bias plus a sequence of sinusoidal harmonics.
  • It estimates harmonic frequencies with the Quinn–Fernandes method instead of fixing them to a standard Fourier grid.
  • The fitting procedure adds harmonics sequentially and fits each new component to the remaining residual.
  • Least squares estimates the coefficients for each fitted frequency, and the resulting components are extended forward.
  • The indicator offers a past start point for reviewing projections but supplies no measured forecast accuracy or trading evidence.

Tags

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