OPEN-SOURCE SCRIPT
Haar Wavelet Range Filter [Jamallo]

Intro
Haar Wavelet Range Filter [Jamallo]
Standard moving averages often struggle with a fundamental trade-off: they are either too fast (reacting to every bit of market noise) or too slow (lagging behind actual trend shifts). This indicator solves that problem by moving away from time-based averaging and into the frequency domain.
By utilizing a Maximal Overlap Discrete Wavelet Transform (MODWT) with a Haar basis, this filter decomposes price action into specific "energy levels." It isolates the core trend from the high-frequency "chatter" (wicks and micro-jitters). The result is a highly responsive, shift-invariant trend line that stays flat during consolidation and moves decisively when a true volatility-backed shift occurs.
How It Works
The indicator processes price through a multi-stage signal processing pipeline:
Stage 1 — MODWT Haar Decomposition
Instead of a simple windowed average, the engine performs a wavelet decomposition. It splits the price into Scaling coefficients (the smooth trend) and Detail coefficients (the noise/volatility).
Stage 2 — Adaptive Detail-Energy Deadband
The "step-like" nature of the filter is driven by an automated threshold. The indicator measures the Detail Energy—essentially the absolute volatility of the noise at your chosen scale.
Stage 3 — Non-Parametric Percentile Bands
Rather than using standard deviation (which assumes price follows a normal "Bell Curve" distribution), this indicator uses Linear Interpolation Percentiles.
Haar Wavelet Range Filter [Jamallo]
Standard moving averages often struggle with a fundamental trade-off: they are either too fast (reacting to every bit of market noise) or too slow (lagging behind actual trend shifts). This indicator solves that problem by moving away from time-based averaging and into the frequency domain.
By utilizing a Maximal Overlap Discrete Wavelet Transform (MODWT) with a Haar basis, this filter decomposes price action into specific "energy levels." It isolates the core trend from the high-frequency "chatter" (wicks and micro-jitters). The result is a highly responsive, shift-invariant trend line that stays flat during consolidation and moves decisively when a true volatility-backed shift occurs.
How It Works
The indicator processes price through a multi-stage signal processing pipeline:
Stage 1 — MODWT Haar Decomposition
Instead of a simple windowed average, the engine performs a wavelet decomposition. It splits the price into Scaling coefficients (the smooth trend) and Detail coefficients (the noise/volatility).
- Unlike standard DWT, this uses MODWT, making it shift-invariant. This means the filter doesn't "jump" or repaint when new bars arrive; the relationship between price and the wavelet remains constant over time.
- The Decomposition Level (1–5) dictates the scale of the trend, ranging from ultra-fast 2-bar captures to macro 32-bar structural cycles.
Stage 2 — Adaptive Detail-Energy Deadband
The "step-like" nature of the filter is driven by an automated threshold. The indicator measures the Detail Energy—essentially the absolute volatility of the noise at your chosen scale.
Stage 3 — Non-Parametric Percentile Bands
Rather than using standard deviation (which assumes price follows a normal "Bell Curve" distribution), this indicator uses Linear Interpolation Percentiles.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.