Statistics

Z-score of the price

The price z-score explained: how many standard deviations from the mean, ±2 extremes, mean reversion and z-score alerts.

4 min readUpdated

The z-score of the price says how many standard deviations the current price is from its recent average. 0 is exactly average; +2 is unusually high; −2 is unusually low. It turns "is this price weird?" into a number you can alert on, the same way for every market.

What it measures

where is the mean and the standard deviation of the last 20 closes. It is unit-free: z = 2 means the same thing on BTC, on a stock and on a small coin.

If prices were normally distributed, |z| > 2 would happen about 5 % of the time and |z| > 3 about 0.3 %. Real markets have fat tails: extremes happen more often, which is precisely why big z-scores deserve attention.

Try it

The z-score shoots past −2 in the drop and swings around 0 in the range. The dashed line on the price is the mean it measures against.

PriceSMA 20Z-score 20Example market · hover to read values
Price, SMA 20, Z-score 20 on an example market: a rise, a sideways range, a sharp drop and a recovery.113.1highlow02-2

How Subtrigger computes it

CryptoUS stocks and ETFs
Period2020
Bar1 minute5 minutes
First valueright away on Binance, after 20 bars elsewhereafter 20 bars
Streamind:zscore_20_1m@binance.miniticker:BTCUSDT:valueind:zscore_20_5m@nasdaq.stocks:NVDA:value

The window includes the forming bar, and the standard deviation is the population one. If all 20 closes are equal there is no value (no spread to measure against).

How to read it

zPrice is…
above +3extremely high for the window
+2 to +3unusually high
−1 to +1ordinary
−2 to −3unusually low
below −3extremely low

Alert ideas

BTC unusually low against its last 20 minutes:

Alert idea

BTCUSDT Z-score 20 · 1m · Binance < -2.5

Create this alert

A stock stretched upward:

Alert idea

NVDA Z-score 20 · 5m > 2.5

Create this alert

Mean reversion and its limits

The z-score is the core of statistical mean-reversion trading: buy at −2, take profit near 0. That works when the market is ranging and the mean is stable. It fails when:

  • a trend starts: the mean moves, and the z-score stays extreme for a long time;
  • volatility jumps: σ rises after the move, which pulls z back toward 0 even if the price keeps going.

For pros

  • Z-score of returns vs of prices. This stream is the z-score of the price level. For "how unusual is this move", divide a return (ROC) by volatility instead.
  • Spreads and pairs. Pairs traders compute the z-score of a spread between two assets; the cross-exchange spread is a natural candidate.
  • Bollinger Bands: the same idea drawn as bands.
  • RSI: bounded momentum instead of distance.
  • Volatility: the dispersion the z-score divides by.

FAQ

What z-score is "extreme"?

Beyond ±2 is unusual, beyond ±3 rare. On 1-minute crypto bars ±2 happens several times a day; ±3 is a real event.

Why does the z-score fall back while the price keeps falling?

The mean follows the price and σ grows with the move, so after a while the same price is less unusual against the new window.

Can the z-score be infinite?

No. When all closes in the window are equal there is no value at all, instead of a division by zero.