Trend Sniper v2.5 - Haar Wavelet Edition [Jamallo]Author's Note:
The previous Trend Sniper v2.5 was built around a 2-Pole Butterworth Super Smoother with Parkinson historical volatility driving the trailing stops. This edition replaces that entire core with a Maximal Overlap Discrete Wavelet Transform (MODWT) using Haar basis functions and a Vervoort ATR trailing stop . Where the Butterworth produced smooth, continuous curves, the Haar wavelet produces structural steps — only updating when true market movement exceeds the calculated noise energy floor. Same Trend Sniper framework, completely different engine under the hood.
Intro
Trend Sniper v2.5 - Haar Wavelet Edition the Maximal Overlap Discrete Wavelet Transform (MODWT) using Haar basis functions. The result is a structural, step-based signal line that ignores minor price fluctuations entirely and only updates when true market movement exceeds a dynamically calculated noise threshold. Combined with a Vervoort ATR trailing stop, dual SuperTrend envelopes, and KAMA midpoint, this indicator provides a complete trend-following framework built on signal processing principles rather than traditional moving average logic.
Breakdown
Haar Wavelet Signal Line (MODWT + Adaptive Deadband)
The core of this indicator is a 5-level cascaded MODWT Haar wavelet decomposition applied to smoothed Heikin-Ashi price. At each level, price is split into a smooth coefficient (trend) and a detail coefficient (noise). The user selects a decomposition level (1–5), controlling the structural scale — from 2-bar micro-structure up to 32-bar macro-structure.
An adaptive deadband then wraps the smooth coefficient: the average absolute detail energy is measured over a lookback window and scaled by a multiplier. The signal line only steps to a new value when the smooth coefficient moves beyond this noise-energy threshold. This creates the characteristic "staircase" behavior — flat holds during noise, clean steps on real moves. The signal line colors by its own step direction: bull when it steps up, bear when it steps down.
Vervoort ATR Trailing Stop
A Sylvain Vervoort-style trailing stop is anchored directly to the Haar wavelet signal line rather than raw price. The stop distance is calculated as ATR × multiplier. In an uptrend, the stop ratchets upward and never retreats; in a downtrend, it ratchets downward. The stop flips when price closes through it. Because it's anchored to the structural wavelet line instead of noisy price, it produces cleaner, more decisive flip points.
The trailing stop uses independent CMO (Chande Momentum Oscillator) + deadband hysteresis for its coloring — it only changes color when confirmed momentum cleanly breaches the CMO threshold, preventing color flicker during consolidation.
Dual SuperTrend Envelopes
Two SuperTrend calculations using smoothed Heikin-Ashi ATR create the outer structure:
Slow SuperTrend (default mult 9.0) — the wide envelope defining macro trend boundaries
Fast SuperTrend (default mult 6.0) — combined with the signal line to create the Fast Trigger dots
The Fast Trigger is the midpoint of the fast SuperTrend and the Haar signal, plotted as orange circles for quick visual reference of momentum alignment.
KAMA Midpoint & 4-State Fill
A Kaufman Adaptive Moving Average smooths the midpoint between the slow SuperTrend and the Haar signal. The fill between the KAMA midpoint and the signal line uses four distinct color states based on whether price is above/below the slow SuperTrend and whether the signal is above/below the fast trigger — providing an immediate visual read on trend alignment and momentum phase.
End
The wavelet decomposition reveals the true step-by-step nature of price movement by mathematically separating signal from noise — use it alongside your own risk management and confluence analysis. Trade the structure, not the noise.
Pine Script® インジケーター






















