Skip to main content

Z-Score

Z-Score of an asset's price.

Indicator appearance.

Indicator appearance.

Description​

The standard score (Z-Score) is a measure of relative dispersion of an observed or measured value. It shows how many standard deviations the value lies from the mean.

How Z-Score is calculated​

The Z-Score indicator measures how far the current price deviates from its moving average, in standard deviations.

Moving average of the closing price over \( n \) periods:

MAt=∑i=0n−1Ct−inMA_t = \frac{ \sum_{i=0}^{n-1} C_{t-i} }{n}

where:

  • MAtMA_t — moving average of the closing price,
  • CtC_t — closing price,
  • nn — number of periods.

Standard deviation of the closing price over \( n \) periods:

σt=1n∑i=0n−1(Ct−i−MAt)2\sigma_t = \sqrt{ \frac{1}{n} \sum_{i=0}^{n-1} (C_{t-i} - MA_t)^2 }

where:

  • σt\sigma_t — standard deviation of the closing price over nn periods.

Z-Score calculation:

Zt=Ct−MAtσtZ_t = \frac{C_t - MA_t}{\sigma_t}

where:

  • ZtZ_t — Z-Score, which shows how far the current price is from the mean in units of standard deviation.

Indicator​

The indicator is called [SF] Z-score (listed as [SFQA] Z-score) and is available on all plans.

Do not confuse it with DOM z-score: there the z-score is computed on the resting order size in the book, not on price.

ParameterDefaultWhat it sets
SymbolemptyAsset. Empty means the chart ticker
Price sourceclosePrice source: open, high, low, close, hl2, hlc3, ohlc4
MA typeSMAAverage type: SMA, EMA, WMA, VWMA, LSMA
Length240Number of periods nn
Sigma multiplier3Threshold in standard deviations: Z-Score going beyond +threshold or −threshold is highlighted