2.38 Causal Wavelet Filters and the Mexican Hat
A wavelet is a band-pass whose width scales, so one Mexican Hat (the 2nd derivative of a Gaussian) scans every cycle at once. Compact support makes it usable; the resolution tradeoff makes it honest.
Aligrithm is an independent research publication on systematic trading, quantitative research, market microstructure, and adaptive systems. Long-form essays, code notebooks, and architecture breakdowns across eight pillars, built for traders who care more about how markets behave than about hype.
More about the publication →Read in order. Each pillar walks you out of one trap with one new ability. The newest article is the worst place to begin.
A wavelet is a band-pass whose width scales, so one Mexican Hat (the 2nd derivative of a Gaussian) scans every cycle at once. Compact support makes it usable; the resolution tradeoff makes it honest.
Estimate slope from a 4-point cubic with skipped taps and the modified EMA turns faster and lags less. But a derivative is no low-pass: the output is not smooth, and that is the real trade.
The zero-lag EMA borrows the Kalman predict step: smooth Price + kappa*velocity, so the slope cancels lag in trends. The same guess overshoots reversals, so it is no turn detector.
A fixed EMA smooths the same in calm and chaos. The adaptive EMA ties alpha to cycle speed: track tight when clean, smooth hard when noisy, at most one bar lag, if you can estimate omega.
The sinc is the exact brick-wall low-pass: full pass below the cutoff, nothing above. But it runs infinitely long and needs future bars, so you build only a truncated, windowed version that rings.
The Butterworth is the maximally flat low-pass: slow cycles pass with no ripple, each pole cuts noise harder. The bill is lag, about one EMA's worth per pole, so two poles is the sweet spot.
Write any linear indicator as a transfer function H(z), a ratio of two short polynomials, and its full behavior reads out: gain at every cycle, lag in bars, and the poles that make it ring.
The market's randomness itself drifts: competition arbitrages structure away, so recent data is more random than old and your backtest edge is an upper bound that decays, not a stable estimate.
Market "long memory" is mostly short-range autocorrelation in disguise: correct for it and the Hurst signal collapses toward random. Kill a striking statistic with the boring explanation first.
Bachelier's normal-price model lets prices go negative; putting the walk on log price fixes it. The twist: raw price fits a log-normal badly, but price divided by volume fits one cleanly.
After a crash the violent days keep coming, dense then fading along the same power-law curve geologists use for aftershocks. Independent returns can't do that, so size down for weeks, not days.
Mandelbrot's stable Paretian family fits markets better than the Gaussian: fat-tailed, fractal, with infinite variance that breaks volatility sizing, Sharpe, and every variance-based risk number.