TradeLabs AILearn

Percentiles, Quantiles and Z-Scores

A z score shows how many standard deviations a value is from its mean. Learn the formula, its uses in mean reversion and pairs trading, and the pitfalls.

Intermediate3 min readUpdated 3 Oct 2026
Markdown
Lesson 9 of 46

A z score tells you how far a value is from its average, measured in standard deviations. A z score of 0 means the value equals the mean; a z score of +2 means it is two standard deviations above; minus 1.5 means one and a half below. Z scores let traders compare moves across assets with different volatilities and spot unusual readings. They are the backbone of many mean reversion, pairs trading and anomaly detection strategies.

The formula#

z = (x - mean) / standard deviation

The mean and standard deviation are usually calculated over a rolling window, such as the last 20 or 60 days. See Rolling and Expanding Windows.

Worked example#

Interpreting z scores#

If values were normally distributed:

Z scoreShare of values beyond this level (one side)
1About 16%
2About 2.3%
3About 0.13%

Market data has fat tails, so extreme z scores occur more often than these figures suggest. A "3 sigma" move might happen several times a year rather than once every few years. See Fat Tails and Normal Distribution.

Uses in trading#

UseExampleLesson
Mean reversion signalsBuy when z falls below minus 2, sell when it rises above +2Mean Reversion
Pairs and spread tradingZ score of the spread between two related assetsPairs Trading
Comparing movesA 3% move in a calm stock vs a volatile one
Bollinger BandsBands at ±2 standard deviations are a visual z scoreBollinger Bands
Factor scoresStandardising value or momentum signals across stocksCombining Signals
Anomaly detectionFlagging unusual volume or spreadsRelative Volume

Z scores of returns#

Instead of prices, traders often compute z scores of returns:

return z score = today's return / standard deviation of recent returns

A 4% drop in a stock with daily volatility of 1% is a minus 4 move, extreme; the same drop in a stock with 3% daily volatility is only about minus 1.3. Standardising this way puts moves on a common scale.

Cross sectional z scores#

Quantitative strategies often standardise a signal across many stocks on the same day: subtract the cross sectional mean and divide by the cross sectional standard deviation. This turns raw values, such as earnings yields, into comparable scores that can be combined. See Factor Investing Explained.

Pitfalls#

  • Fat tails: extreme readings can keep getting more extreme.
  • Trending markets: in strong trends, z scores can stay high or low for long periods; mean reversion trades fight the trend. See Trend Following.
  • Window choice: different lookbacks give different z scores; short windows react fast but are noisy.
  • Non stationary data: if the mean and volatility drift, z scores lose meaning. See Stationarity, Differencing and Unit Roots.
  • Outliers in the window distort the mean and standard deviation. Robust versions use the median and median absolute deviation. See Outliers and Robust Statistics.

Frequently asked questions#

What is a z score?#

A measure of how many standard deviations a value is above or below its average.

How are z scores used in trading?#

To identify unusual prices or spreads for mean reversion and pairs trading, compare moves across assets and standardise signals.

Is a z score of 3 rare in markets?#

Less rare than the normal distribution suggests, because market returns have fat tails.

Next, learn how assets move together in Covariance and Correlation.

Check your understanding

3 quick questions on this lesson. Get them all right to finish it.

Turn on JavaScript to take the quiz.

Finished this lesson?Sign in to save your progress across devices.
Next lessonCovariance and CorrelationCovariance and correlation measure how two assets move together. Learn the formulas, how to read them, why correlations change in crises and their portfolio role.

Mentioned in