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.
How Subtrigger computes it
| Crypto | US stocks and ETFs | |
|---|---|---|
| Period | 20 | 20 |
| Bar | 1 minute | 5 minutes |
| First value | right away on Binance, after 20 bars elsewhere | after 20 bars |
| Stream | ind:zscore_20_1m@binance.miniticker:BTCUSDT:value | ind: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
| z | Price is… |
|---|---|
| above +3 | extremely high for the window |
| +2 to +3 | unusually high |
| −1 to +1 | ordinary |
| −2 to −3 | unusually low |
| below −3 | extremely low |
Alert ideas
BTC unusually low against its last 20 minutes:
Alert idea
BTCUSDT Z-score 20 · 1m · Binance < -2.5
A stock stretched upward:
Alert idea
NVDA Z-score 20 · 5m > 2.5
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.
Related
- 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.
Keep reading
- VolatilityBollinger BandsBollinger Bands and %B explained: the bands, squeezes, band walks, mean reversion and Bollinger alerts on crypto and stocks.
- MomentumRSIRSI explained for beginners and pros: Wilder's formula, overbought and oversold zones, divergences, regimes and RSI alerts.
- VolatilityVolatilityHistorical volatility explained: log returns, standard deviation, calm and stormy markets, and volatility alerts in Subtrigger.