Haar Wavelet Range Filter [Jamallo]Intro
Haar Wavelet Range Filter
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.
Pine Script® göstergesi






















