2.19 Why the SMA Is Often a Terrible Smoother
SMA's sinc response has the worst sidelobes of any common smoother: −13.3 dB (22% leakage) regardless of N. Same lag, Hann leaks 2.6%, Blackman 0.12%. Critical period ~2N. Use Hann or Blackman.
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.
SMA's sinc response has the worst sidelobes of any common smoother: −13.3 dB (22% leakage) regardless of N. Same lag, Hann leaks 2.6%, Blackman 0.12%. Critical period ~2N. Use Hann or Blackman.
Every MA pays a lag tax. Symmetric FIR length N has lag (N−1)/2. On SPX, 200-day SMA captures 18% of a 10% move; 50-day captures 56%. WMA buys lag with phase distortion. Structural trade.
Every linear filter is y(t)=Σ b_k x(t−k)−Σ a_k y(t−k). H(z) has only negative powers, no z⁺¹. Filters summarize the past; they don't extrapolate. SMA(50) on next-day return: R²≈0.0002.
Feature engineering contributes 90-95% of the edge; model selection 5-10%. Same XGBoost: raw OHLC → SPX AUC 0.502; full statistical pipeline → 0.524. Features are IP. The model is a commodity.
Mean breakdown 1/n; median 0.5. On SPX 100-bar center through March 2020, mean spikes 5σ; median moves 0.4. Median for centering, MAD/IQR for spread, Spearman for correlation, LAD for regression.
A wrong-scale sigmoid destroys the signal. Center on training median; scale α so IQR lands in the linear region (α≈1.2 for tanh). On SPX Range/Close, α=1.2 lifts AUC 0.503 → 0.519.
The histogram is the primary diagnostic. Scalars (R/IQR, RE, MI, TCR) confuse shapes needing different fixes. Identical scalars hide light-tail, heavy-tail, or bimodal — only bimodal needs a split.
CMMA fixes Close − MA(k) with log prices, prev-bar MA, ATR with current bar, √(k+1) divisor. On SPX, test/train std ratio drops 5.25 → 1.03; MI lifts 1.4 → 2.0. Pool-compatible.
ATR captures within-bar and between-bar movement in the instrument's own units. On SPX 20d momentum, 2020/2017 std ratio drops 5.0 raw → 1.05 ATR-normalized, no MI loss. Structural, not heuristic.
Six transforms turn non-stationary prices into stationary indicators, log returns to forced centering. Pick the lightest passing ADF, coverage, rolling-variance. ATR-norm 20d momentum wins on SPX.
Raw price is non-stationary in mean, non-stationary in variance, and incomparable across instruments. A model trained on SPX from 1990 to 2010 sees 71% of the 2010 to 2026 test rows outside its training support. The in-sample AUC of 0.582 collapses to 0.498 live.
Long-side and short-side threshold scans on the same indicator are two hypotheses, not one. Equity drift, return skew, and conditional-distribution asymmetry break the mirror.