Harmonic Resonance Oscillator [LuxAlgo]The Harmonic Resonance Oscillator indicator provides a specialized oscillator that decomposes price action into multiple harmonic cycles to identify confluence in market rotations.
By isolating short, medium, and long-term frequencies, the tool aims to pinpoint exhausted price movements and potential reversal zones through the concept of cyclic resonance.
🔶 USAGE
The Harmonic Resonance Oscillator can be used to identify market turning points by observing when the aggregate cycle resonance reaches extreme levels. Unlike standard oscillators that rely on a single lookback period, this tool aggregates multiple filtered cycles to provide a more robust view of market momentum and exhaustion.
When the oscillator enters the dynamic overbought (upper) or oversold (lower) zones, it indicates that the various price cycles are aligning at an extreme, often preceding a corrective move or a trend reversal.
🔹 Harmonic Multipliers
The script uses a Reference Period combined with three multipliers to define the cycles:
The Short Multiplier captures fast, intraday-style fluctuations.
The Medium Multiplier focuses on the primary trend rhythm.
The Long Multiplier tracks broader market cycles.
When all three cycles reach peak or trough levels simultaneously, the oscillator displays a "resonance" peak, which is highlighted by background coloring if the signal exceeds the dynamic thresholds.
🔶 DETAILS
The indicator is built upon three primary technical pillars:
🔹 Ehlers' Bandpass Filter
At its core, the indicator uses John Ehlers' Cycle decomposition method. The bandpass filter is designed to pass only price components within a specific frequency range while attenuating everything else. This allows the script to "tune in" to specific market rhythms without the lag typically associated with moving averages.
🔹 Normalization & Resonance
Each isolated cycle is normalized onto a scale of 0 to 100 using a specific lookback length. The final "Harmonic Resonance" signal is the arithmetic mean of these three normalized cycles. A value of 50 represents a neutral state, while values approaching 0 or 100 represent extreme harmonic alignment.
🔹 Dynamic Volatility-Adjusted Zones
The Overbought and Oversold thresholds are not static. They adjust dynamically based on the standard deviation of the resonance signal. During periods of high cyclic volatility, the bands expand to require stronger confluence for a signal; during low volatility, the bands contract to stay sensitive to smaller market rotations.
🔶 SETTINGS
🔹 Harmonic Settings
Reference Period: The base period used to calculate the harmonic cycles.
Short Multiplier: Multiplier applied to the reference period for the short-term cycle.
Medium Multiplier: Multiplier applied to the reference period for the medium-term cycle.
Long Multiplier: Multiplier applied to the reference period for the long-term cycle.
Bandwidth: Controls the "tightness" of the bandpass filter. Lower values isolate specific cycles more precisely.
🔹 Normalization Settings
Normalization Lookback: The window used to scale the cycles and calculate the volatility of the resonance signal.
🔹 Overbought / Oversold Control
Overbought Threshold: The base level for the upper dynamic zone (default 80).
Oversold Threshold: The base level for the lower dynamic zone (default 20).
🔹 Style
Bullish Color: Color of the oscillator when above the 50 midpoint.
Bearish Color: Color of the oscillator when below the 50 midpoint.
Overbought Color: Color of the upper dynamic threshold.
Oversold Color: Color of the lower dynamic threshold.
Show Background Highlighting: Toggles the background coloring when resonance reaches extreme levels.
Pine Script® indicator






















