2.36 Zero-Lag EMA: The Kalman Filter, Simplified
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.
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.
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.
Fat tails wreck Gaussian risk models and are also why trend following pays: the big moves the bell curve forbids cluster into trends and produce the rare giant winners that fund the small losses.
The COT index dies on currencies for a structural reason: futures are the whole hedging market in commodities but a rounding error in FX. No amount of tuning fixes an unrepresentative sample.