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 de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.