blog · ~6 min read

Time Series Basics: Autocorrelation and Stationarity

Price is a time series, and most trading models assume things about it that often aren't true. Learn autocorrelation and stationarity before you trust any indicator.

T By tradernewbie · Curated for beginners
#statistics#quantitative
Cet article est en anglais. Voulez-vous le voir dans votre langue ? Google Translate →

Les outils interactifs peuvent ne pas fonctionner dans la vue traduite.

Time Series Basics: Autocorrelation and Stationarity

A strategy built on price series that "change character" is a strategy built on sand.

Most indicators and models assume the data they're applied to behaves consistently over time. Time-series statistics exist to check whether that assumption holds. Two concepts matter more than the rest: autocorrelation and stationarity.

Autocorrelation: does today relate to yesterday?

Autocorrelation measures how a series correlates with a lagged copy of itself:

ρk = Cov(yt, yt−k) ÷ Var(yt)

Where ρk is the autocorrelation at lag k.

  • Positive autocorrelation → trend persistence. Today's up-move predicts more up-moves (momentum markets)
  • Negative autocorrelation → mean reversion. Up-moves tend to reverse (choppy markets)
  • Near zero → essentially random walk

This is why trend-following works in some markets and mean-reversion works in others: they're harvesting different autocorrelation regimes. Measure ρk before deploying either approach.

Stationarity: do the rules stay fixed?

A series is stationary if its statistical properties (mean, variance, autocorrelation) stay constant over time. Price itself is non-stationary — it wanders, trends, and drifts. Returns are more stationary, but volatility clustering still violates the assumption.

The classic test is the Augmented Dickey-Fuller (ADF) test:

  • H0: the series has a unit root (non-stationary)
  • H1: the series is stationary
  • Reject H0 → safe to apply standard statistical tools

Non-stationary data breaks the math behind most indicators, regressions, and risk models. That's why quant workflows often difference the series (convert prices to returns) before analysis.

Why this matters for traders

  1. Backtest validity: a strategy that worked in a 2010–2020 sample may fail in 2024 because the regime changed — non-stationarity in action
  2. Cointegration: pairs trading requires the spread between two assets to be stationary, not the assets themselves. Test before you trade pairs
  3. Indicator stability: moving averages, RSI, and σ-based bands all assume stable underlying properties. When the regime shifts, they lag badly
  4. Risk model failure: VaR and σ-based stops understate risk when volatility regimes change

Practical workflow

  1. Convert prices to log returns before statistical analysis
  2. Plot the autocorrelation function (ACF) to spot trend vs mean-revert regimes
  3. Run ADF to confirm stationarity before trusting regressions or significance tests
  4. Roll the tests over time — stationarity in one window doesn't guarantee it in the next
  5. When regimes shift (ADF flips, ρk flips sign), pause and re-validate your model

Summary

Autocorrelation tells you whether the market is trending or reverting. Stationarity tells you whether your statistical tools are even valid on this data. Test both before you trust any indicator or backtest — and re-test often, because in markets, the rules of the game keep changing.

Related market data, powered by TradingView.

Educational content · Not financial advice · Trade at your own risk