Z-score
Short answer
A z-score expresses how far a value is from its average, measured in standard deviations. In trading it is used to judge how unusually stretched a price, spread or other series is compared with its own recent history.
Raw distances are hard to compare. A move that is large for a quiet asset may be ordinary for a volatile asset. The z-score fixes this by dividing the distance from the average by the usual size of variation. The result has no units: small values are ordinary, and large values, above or below the average, are unusual.
How it is used in strategy design and testing
In strategy design, the z-score is the most common way to measure stretch in mean-reversion and pairs trading. The designer chooses what series to score, such as a price, a spread or a residual, and how to compute its average and its standard deviation. Those choices matter: a short history reacts quickly but is noisy, while a long history is smoother but slow to adapt.
In testing, the key point is that the average and standard deviation must be computed from past data only at each date. Using the whole sample leaks future information. Testers also check whether the series is stationary, because a z-score on a series that trends away has no stable anchor, and check how results change across a range of reasonable choices rather than a single tuned setting.
Common mistakes
- Assuming a normal distribution. Market data has fat tails, so extreme z-scores happen more often than textbook tables suggest.
- Full-sample statistics. Computing the average over the whole history is a form of look-ahead bias.
- Scoring a trending series. Without stationarity, a high score can keep rising.
- Tuning the window to the past. The strongest-looking window on old data is often fitted to noise.
Related
- Strategy guides: Mean reversion, Pairs trading and statistical arbitrage
- Related terms: Stationarity, Half-life of mean reversion, Bollinger Bands, Cointegration
Education only. Not investment advice.
Questions people ask
What is a z-score in trading?
It is a measure of how far a price or spread is from its average, in units of its usual variation. Traders use it to see whether a move is ordinary or unusual.
How is a z-score calculated?
Subtract the average of the series from the current value, then divide by the standard deviation of the series. In trading, the average and standard deviation come from a rolling window of past data.
What does a high z-score mean?
It means the value is far above its usual level relative to normal variation. Whether that suggests a reversal or a continuing move depends on the market and the strategy.
Why is the z-score used in pairs trading?
It gives a common scale for how stretched a spread is, so the trader can compare different pairs and set consistent rules.