Fourier Extrapolator of Price w/ Projection Forecast [Loxx]Due to popular demand, I'm pusblishing Fourier Extrapolator of Price w/ Projection Forecast.. As stated in it's twin indicator, this one is also multi-harmonic (or multi-tone) trigonometric model of a price series xi, i=1..n, is given by:
xi = m + Sum( a*Cos(w*i) + b*Sin(w*i), h=1..H )
Where:
xi - past price at i-th bar, total n past prices;
m - bias;
a and b - scaling coefficients of harmonics;
w - frequency of a harmonic ;
h - harmonic number;
H - total number of fitted harmonics.
Fitting this model means finding m, a, b, and w that make the modeled values to be close to real values. Finding the harmonic frequencies w 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;
Nfut - number of predicted future bars;
nharm - total number of harmonics in model;
frqtol - tolerance of frequency calculations.
The indicator plots two curves: the green/red curve indicates modeled past values and the yellow/fuchsia curve indicates the modeled future values.
The purpose of this indicator is to showcase the Fourier Extrapolator method to be used in future indicators.
Fourier
Fourier Extrapolator of Price [Loxx]Fourier Extrapolator of Price is a multi-harmonic (or multi-tone) trigonometric model of a price series xi, i=1..n, is given by:
xi = m + Sum( a *Cos(w *i) + b *Sin(w *i), h=1..H )
Where:
xi - past price at i-th bar, total n past prices;
m - bias;
a and b - scaling coefficients of harmonics;
w - frequency of a harmonic;
h - harmonic number;
H - total number of fitted harmonics.
Fitting this model means finding m, a , b , and w that make the modeled values to be close to real values. Finding the harmonic frequencies w 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.
OPAL - Sense→ Hi everyone, very proud to publish my unique leading oscillator ! ←
Sense is a "leading indicator" : it shows what can happen in the future, meanwhile a lagging indicator like MAs shows past sentiment.
Sense diverging with Price ? Care at the reversal !
It can be a great tool to upgrade your timings, after a divergence for example, to snipe reversals or to find Trend entries.
This tool is used for sniping in our levels trading setup (in our trading community)
Sense is made of everything you know about common indicators :
RSI/STOCH/STOCHRSI/MFI/RVSI/PZO/VZO/MOMENTUM/VOLUMES/UO
>>> Basically shows situations where almost all the known indicators reach interesting points in Overbought and Oversold zones
Signals provided :
*Visible and Hidden Minor OB/OS Crosses (Small Arrows)
*Visible and Hidden Major OB/OS Crosses (Bigger Arrows)
*Visible and Hidden Major and Minor Confluence in OB/OS Zones (Rockets/Blood)
*Background Smart Coloring when price reaches OB/OS Zones :
- blue/purple = entering OB/OS Zones
- green/red = extrem multiple OB/OS situation
*Coloration of Middle Line based on std Price Deviation
*Smart Divergences spotting : applied level filter to get divergences that reached OB/OS Zones at least once.
Divergences are scanned twice for confirmation<
*Full alerting system on :
- Full signals = blood and rockets
- Half signals = bigger arrows
- Minor signals = small arrows
- Dual Divergences = on both oscillators (slow & fast)
1) What is the curve i see on Sense ? => It is my homemade oscillator, described above
2) What are thoses Zones around the curve ? => Overbought/Oversold Zones
3) What are those dots on the curve ? => When the oscillator crosses its Triggerline
4) What are those little arrows ? => Printing minor Overbought/Oversold situations
5) What are those bigger arrows ? => Printing major Overbought/Oversold situations
6) What are those Blood dots/ Rockets ? => Printing Confluence situations in Overbought/Oversold Zones
7) Why is background coloring ? => I applied smart coloration based on oscillators location (see above coloration meaning)
8) What are those lines between curve spikes ? => Situations when Price and oscillator are doing different moves, basically divergences, meaning a correction can happen sooner or later
Should be strong on almost every timeframe !
Always backtest, watch, then use or not in your trading strategy.
If you like my work, leave a like :)
Hoping you success !
Function Sawtooth WaveThis is an indicator to draw a sawtooth wave on the chart.
It can be a useful perspective, as decaying markets tend to oscillate in reverse sawtooth waves, and bullish markets can oscillate in conventional sawtooth waves. With the right inputs, it can be an early warning signal for potential movements.
Something I've noted is that large waves cause a ripple effect and sets the frequency for the market until a change occurs. Sawtooth waves may help in capturing ripple waves.
Useful inputs are:
- Average True Range as wave height (amplitude)
- Periodicity of market as wave duration (frequency)
(Inputs will change the wave from conventional to reverse)
I hope that it is helpful.
GLHF
- DPT
Function: Discrete Fourier TransformExperimental:
function for inverse and discrete fourier transform in one, if you notice errors please let me know! use at your own risk...
Ehlers Discrete Fourier TransformThe Discrete Fourier Transform Indicator was written by John Ehlers and more details can be found at www.mesasoftware.com
I have color coded everything as follows: blue line is the dominant cycle, orange line is the power converted to decibels, and I have marked the other line as red if you should sell or green if you should buy
Let me know if you would like to see me write any other scripts!
Low Frequency Fourier TransformThis Study uses the Real Discrete Fourier Transform algorithm to generate 3 sinusoids possibly indicative of future price.
I got information about this RDFT algorithm from "The Scientist and Engineer's Guide to Digital Signal Processing" By Steven W. Smith, Ph.D.
It has not been tested thoroughly yet, but it seems that that the RDFT isn't suited for predicting prices as the Frequency Domain Representation shows that the signal is similar to white noise, showing no significant peaks, indicative of very low periodicity of price movements.
Fourier series Model Of The Market█ OVERVIEW
The Fourier Series Model of the Market (FSMM) decomposes price action into harmonic components using bandpass filtering, then reconstructs a composite wave weighted by rolling energy ratios. This approach isolates cyclical market behavior at multiple frequencies, emphasizing dominant cycles for cleaner signal generation. The energy-adaptive weighting is the key differentiator from simple harmonic summation: cycles that dominate current price action contribute more to the output.
Based on Fourier analysis principles applied to financial markets, the indicator extracts harmonics (fundamental, 2nd, 3rd, etc.) using second-order IIR bandpass filters, then weights each harmonic's contribution by its relative energy compared to adjacent harmonics. This energy-adaptive weighting naturally emphasizes the cycles that are most prominent in current market conditions.
█ CONCEPTS
Fourier Decomposition
Fourier analysis represents any periodic signal as a sum of sine waves at different frequencies. In market analysis, price action can be decomposed into a fundamental cycle (the base period) plus harmonics at integer multiples of that frequency (period/2, period/3, etc.). Each harmonic captures oscillations at a specific frequency band, and their sum reconstructs the original cyclical behavior.
Bandpass Filtering
Each harmonic is extracted using a second-order IIR (Infinite Impulse Response) bandpass filter tuned to that harmonic's frequency. The filter isolates price activity within a narrow frequency range while rejecting both higher-frequency noise and lower-frequency trend drift. Before filtering, the source is debiased via 2-bar momentum to remove DC offset, ensuring each bandpass operates around true zero.
Energy-Weighted Reconstruction
Rather than simply summing all harmonics equally, FSMM weights each harmonic by its rolling energy relative to the previous harmonic. The energy score combines the current harmonic value with its rate of change, so it reflects both amplitude and momentum. Higher harmonics that hold comparatively more energy therefore contribute more to the composite wave, while weaker harmonics fade out. This adaptive weighting allows the model to respond to changing market cyclicality.
Quadrature Component (Rate of Change)
The rate of change output represents the 90°-phase-shifted (quadrature) component of the wave. When the wave is at zero and rising, the rate of change is at maximum positive. This provides complementary information about cycle phase and can be used for timing entries relative to cycle position.
█ INTERPRETATION
Wave Output
The composite wave oscillates around zero, representing the sum of all extracted harmonic components weighted by energy:
• Above zero : Net bullish cyclical momentum across harmonics
• Below zero : Net bearish cyclical momentum across harmonics
• Zero crossings : Cycle phase transitions - potential reversal points
• Wave amplitude : Strength of cyclical behavior; larger swings indicate cleaner cycles
Rate of Change
The quadrature component (90° phase-shifted) provides cycle phase information:
• Maximum rate of change : Wave is near zero and accelerating - early cycle phase
• Zero rate of change : Wave is at peak or trough - cycle extremes
• Rate/Wave divergence : When wave makes new highs/lows but rate of change does not confirm (lower momentum), suggests cycle exhaustion or impending phase shift
Combined Analysis
• Wave crossing above zero with positive rate of change: Strong bullish cycle initiation
• Wave crossing below zero with negative rate of change: Strong bearish cycle initiation
• Wave at extreme with rate of change reversing: Potential cycle peak/trough
Threshold Bands
When enabled, threshold bands define statistically significant wave deviations:
• Breach above +threshold : Unusually strong bullish cyclical behavior
• Breach below -threshold : Unusually strong bearish cyclical behavior
• Return inside thresholds : Normalizing behavior, potential mean reversion ahead
Alert Conditions
Four built-in alerts trigger on bar close (no repainting):
• Above +Threshold : Strong bullish cycle behavior
• Below -Threshold : Strong bearish cycle behavior
• Above Zero : Bullish cycle phase shift
• Below Zero : Bearish cycle phase shift
█ SETTINGS & PARAMETER TUNING
Fourier Series Model
• Source : Price series to decompose into harmonic components.
• Period (6-100): Base period for the fundamental harmonic. Higher harmonics divide this period (harmonic 2 = period/2, harmonic 3 = period/3). Match to the dominant market cycle for best results. Default 20.
• Bandwidth (0.05-0.5): Bandpass filter selectivity. Lower values create narrower passbands that isolate harmonics more precisely but may miss slightly off-frequency cycles. Higher values capture broader ranges but reduce harmonic separation. Default 0.1 balances precision and robustness.
• Harmonics (1-20): Number of harmonic components to extract. More harmonics capture finer cyclical detail but increase computation. For most applications, 3-5 harmonics suffice. The fundamental alone (1 harmonic) functions as a simple bandpass filter.
Display Settings
• Wave Outputs : Toggle visibility and color of the composite Fourier wave.
• Rate of Change : Toggle visibility and color of the quadrature component (90° phase-shifted wave).
• Zero Line : Reference line for oscillator neutrality.
Diagnostics - Dynamic Thresholds
Optional significance bands that identify when wave readings indicate strong cyclical behavior:
• Dynamic Threshold : Toggle threshold bands and set colors.
• Threshold Mode : Select calculation method:
- MAD (Median Absolute Deviation) : Robust, outlier-resistant measure using k * MAD where MAD ≈ 0.6745 * stdev.
- Standard Deviation : Volatility-sensitive, calculated as k * stdev of wave over the lookback period.
- Percentile Rank : Fixed probability bands using percentile of |wave| (90% means only 10% of values exceed threshold).
• Period (2-200): Lookback for threshold calculations. Default 50.
• Multiplier (k) : Scaling for MAD/Standard Deviation modes. Default 1.5.
• Percentile (%) (0-100): For Percentile Rank mode only. Default 90%.
Parameter Interactions
• Shorter periods respond faster to cycle changes but may capture noise.
• Lower bandwidth + more harmonics = more precise decomposition but requires accurate period setting.
• Higher bandwidth is more forgiving of period mismatches.
• For strongly trending markets, restrict harmonics to 1-2 so the model tracks the dominant cycle with fewer higher-frequency components.
• For ranging/oscillating markets, more harmonics (4-6) capture complex cycles.
█ LIMITATIONS
Inherent Characteristics
• Period dependency : Effectiveness depends on correctly matching the Period parameter to actual market cycles. Use cycle measurement tools (autocorrelation, FFT, dominant cycle indicators) to identify appropriate periods.
• Stationarity assumption : The indicator assumes cycle frequencies remain relatively stable within the lookback window. Rapidly shifting dominant cycles (regime transitions) may produce inconsistent results until the buffer adapts.
• Filter lag : Despite bandpass design, some lag remains inherent to causal filtering. Higher harmonics have less lag but more noise sensitivity.
• Energy weighting artifacts : During regime changes when harmonic energy ratios shift rapidly, weighting may produce transient anomalies.
Market Conditions to Avoid
• Strong trending markets : Pure trends with no cyclicality produce weak, meandering signals. The indicator assumes cyclical market behavior.
• News events/gaps : Large discontinuities disrupt filter continuity. Requires 1-2 full periods to stabilize.
• Period mismatch : If the Period parameter doesn't match actual market cycles, harmonic extraction produces noise rather than signal.
Parameter Selection Pitfalls
• Too many harmonics : Beyond 5-6 harmonics, additional components often capture noise rather than meaningful cycles.
• Bandwidth too narrow : Very low bandwidth (< 0.05) requires extremely precise period matching; slight mismatches cause signal loss.
• Over-optimization : Perfect historical parameter fits typically fail forward. Use robust defaults across multiple instruments.
█ NOTES
Credits
This indicator applies Fourier analysis principles to financial market data, building on the extensive work of Dr. John F. Ehlers in applying digital signal processing to trading. The bandpass filter implementation and harmonic decomposition approach draw from DSP fundamentals as presented in Ehlers' publications.
For those interested in the underlying mathematics and DSP concepts:
• Ehlers, J.F. (2001). Rocket Science for Traders: Digital Signal Processing Applications . John Wiley & Sons.
• Ehlers, J.F. (2013). Cycle Analytics for Traders . John Wiley & Sons.
• Various TASC articles by John Ehlers on bandpass filters, cycle analysis, and harmonic decomposition.
by ♚@e2e4
Regularized Volume Zone Oscillator FSVZORegularized VZO
Vanilla in link below
White noise and 1 confirm auto divs included









