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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Join the Growing (Econophysics Trading) Community! ⚛️
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
discord.com/invite/qb4RKFdwYJ
Trade the physics of price.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.