The Claude Quant PlaybookDownload ebookDownload ebook

z-score

beginnerDistributions8 of 11

A z-score puts any value on a common scale: how many standard deviations it sits above or below the mean. Under a normal model it tells you how rare the value is.

Build a trading system with Claude.Download ebook

01The formula

how many standard deviations x is from the mean
the value you observed, such as today's return
the mean of the distribution
its standard deviation

02See it move

03Where it is used

04Why traders use it

A 3% move means little until you know the volatility. The z-score turns it into a size you can compare across assets and periods.

05Worked example

Today's return is −3.0% for an asset with mean 0.05% and daily volatility 1.2%. Its z-score is −2.54. Under a normal model a day this far out on that side happens with chance 0.55%, about one day in 181.

06How it is built

  1. Subtract the mean: is how far the value is from typical.
  2. Divide by to measure that distance in standard deviations.
  3. If is normal, is a draw from the standard normal, so (or ) is its tail chance.

07The common mistake

Using a z-score's tail chance for fat-tailed data. A z of −5 'should' happen once in millions of days under a normal, yet markets produce such days every few years.

08In Python and LaTeX

from scipy.stats import norm
x, mu, sigma = -0.03, 0.0005, 0.012
z = (x - mu) / sigma
print(round(z, 2), round(norm.cdf(-abs(z)), 4))
z = \frac{x - \mu}{\sigma}

09Where it fits

Rather not code the maths yourself? Describe your trading idea and let AI build the bot.

Build a bot with AgenKit

The worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.