reference · Performance & testing

Standard Deviation of Returns: Calculate and Interpret Volatility

Standard deviation measures dispersion around a mean. Applied to returns, it is one description of historical variability; it does not by itself measure maximum loss or prove that returns are normally distributed.

TradeCopier Editorial TeamPublished Updated
Arranged sample blocks and measurement tools illustrating careful performance testing
Editorial illustration. Examples and calculations below state their own assumptions.

Key points

  • Sample and population denominators produce different results.
  • Standard deviation returns to the units of the input data.
  • Annualizing with a square-root rule requires assumptions about time dependence.
  • A z-score is unitless, but its reference window and denominator must be specified.
  • An observation changes its own reference when included in the rolling mean and standard deviation.

Specify the series and denominator

Choose a consistent return interval, such as daily close-to-close returns after documented cash-flow and cost treatment. The sample variance sums squared deviations from the sample mean and divides by n − 1. Its square root is sample standard deviation. A population calculation instead divides by n, so the two outputs should not be compared without labels.

NIST defines variance and standard deviation as measures of scale. Squaring gives large deviations more influence. Taking the square root restores the original units, which matters when distinguishing decimal returns from percentages.

Calculate a four-observation example

Use hypothetical returns of −2%, 0%, +2% and +4%. Their arithmetic mean is +1%. Deviations from that mean are −3, −1, +1 and +3 percentage points. Squared deviations sum to 9 + 1 + 1 + 9 = 20 squared percentage points.

Sample variance is 20 ÷ 3, and sample standard deviation is the square root of that value, approximately 2.58199 percentage points per observation interval. Using the population denominator gives the square root of 20 ÷ 4, approximately 2.23607. If returns were entered as −0.02, 0, 0.02 and 0.04, the sample result would be 0.0258199; multiply by 100 to express it in percentage points.

Do not turn a convention into a guarantee

A common annualization convention multiplies daily standard deviation by the square root of an assumed number of observations per year. That scaling is connected to assumptions about stable variance and uncorrelated increments. Serial correlation and changing volatility can make it a poor description of longer-horizon behavior.

Keep the chosen annual observation count visible. A daily series that includes weekends is not automatically comparable with one containing only trading sessions. Missing days, stale valuations and mismatched close times can artificially lower or alter measured variability. Check the return construction before debating the annualization factor.

Inspect information the statistic leaves out

Standard deviation treats upside and downside deviations symmetrically. Two series can share the same value while differing in asymmetry, extreme losses and sequence. A strategy with rare severe outcomes may appear stable in a sample that missed those outcomes. Do not convert a standard deviation into a loss probability without an explicit, justified distributional model.

Report sample length, dates, mean, large observations and drawdown alongside the result. A single observation cannot support sample standard deviation with n − 1 in the denominator, and a constant series has zero observed dispersion without proving zero future risk. For source and follower accounts, align currencies, valuation timestamps and cash-flow treatment. Differences in measurement frequency can otherwise be mistaken for differences in trading quality.

Calculate a z-score indicator from an explicit reference window

A z-score describes an observation's distance from a chosen mean in standard-deviation units: z = (observation − reference mean) ÷ reference standard deviation. It is unitless because the numerator and denominator have the same units. For returns, subtracting two percent returns produces a difference in percentage points. Standardizing prices answers a different question from standardizing returns; label which series you used.

NIST describes z-scores and their limitations for identifying outliers. A large magnitude can prompt investigation, but does not establish an error or a profitable trade. Positive means above this reference mean; negative means below it. Zero means equal to the reference mean when the denominator is positive.

Compare lagged and current-inclusive windows

Continue the hypothetical return sequence above with a new return of +8%. For a lagged four-observation reference, keep −2%, 0%, +2%, +4% fixed while measuring the new observation. The mean remains +1%, sample standard deviation remains √(20 ÷ 3), and z = (8 − 1) ÷ √(20 ÷ 3) = 2.711088. Choosing the population divisor for exactly the same four inputs gives z = 7 ÷ √5 = 3.130495. Neither difference is a price-feed discrepancy.

A current-inclusive four-observation rolling calculation instead drops −2% and uses 0%, +2%, +4%, +8%. The mean becomes +3.5%; squared deviations sum to 35. Sample standard deviation is √(35 ÷ 3) = 3.415650 percentage points, and the current return's z-score becomes (8 − 3.5) ÷ 3.415650 = 1.317465. Its smaller value reflects a changed reference, not a correction to the lagged calculation.

The same eight percent return has sample z-score 2.711088 against the preceding four returns and 1.317465 against a four-return window that includes it
Original hypothetical example. Both methods use four observations, but they answer different comparison questions.
Same +8% observation, different stated references; rounded results
ReferenceVariance divisorMean (%)SD (percentage points)Z-score
Previous four: −2, 0, 2, 4n − 1 = 312.5819892.711088
Previous four: −2, 0, 2, 4n = 412.2360683.130495
Including current: 0, 2, 4, 8n − 1 = 33.53.4156501.317465
Including current: 0, 2, 4, 8n = 43.52.9580401.521278
Previous two: 2, 4n − 1 = 131.4142143.535534

Using only the previous two observations changes the sample score again, to 3.535534. These short windows make the arithmetic easy to reproduce; they are not recommended trading settings. Choose a window using the measurement purpose, available history and evaluation design, rather than selecting the length that makes one historical move look most unusual.

Keep calculation time separate from execution time

A lagged reference through bar t − 1 can be fixed before bar t begins, but a score using the final return at t is not known until that return is observed. A current-inclusive calculation using the completed bar can also be causal if acted on afterward. Including a completed current bar is not inherently future leakage; pretending its final value was known earlier is. An unfinished bar can change both the observation and a current-inclusive reference.

For reproducible evaluation, save the series definition, interval, reference timestamps, observation timestamp, n, divisor and whether the current observation is included. Also record the first time the inputs were available and the next feasible execution opportunity. Do not fit the mean or standard deviation on a full history that includes observations after the decision time. If the reference is rolling, advance it explicitly rather than silently substituting an expanding window.

Handle undefined scores and probability claims

A constant reference has zero standard deviation. Dividing by zero does not produce a usable z-score, even when the new observation equals that constant. Return an unavailable result with a reason; do not replace it with zero or an artificial tiny denominator. With the sample formula, fewer than two reference observations also leaves the result unavailable. A very small positive standard deviation can produce a large score, so inspect stale or rounded inputs before interpreting it.

Rescaling all percent inputs into decimals leaves the z-score unchanged: the mean, difference and standard deviation all scale together. Mixing a percent observation with a decimal standard deviation does not. The downloadable worksheet includes both representations, zero-dispersion cases and an insufficient-history case. Blank numeric cells mean undefined or unavailable; the status column explains why. Values are rounded to 12 decimal places for export.

Download the reproducible z-score window examples (CSV). Each row contains the complete reference sequence in a semicolon-separated field, the observation, divisor, mean, squared-deviation sum, variance, standard deviation and score. Calculate from those original inputs rather than feeding rounded output back into another calculation.

Standardization changes location and scale; it does not make an arbitrary distribution normal. A score of two is not automatically a particular tail probability, a reversal forecast or an instruction to buy or sell. NIST's normal distribution reference describes a specific distributional model. Estimated rolling parameters, dependence and changing return distributions require additional care before that model's probabilities can be applied.

Questions and answers

Is standard deviation the same as maximum drawdown?

No. Standard deviation summarizes dispersion around a mean; maximum drawdown depends on the sequence of equity peaks and troughs.

Why do two spreadsheets return different volatility?

Check sample versus population denominators, decimal versus percentage input, return interval, missing data and the annualization convention.

What is the formula for a z-score indicator?

Subtract the chosen reference mean from the observation and divide by the reference standard deviation. Specify whether the input is price or return, the reference window, and the sample or population divisor. The score is unitless.

Why do sample and population z-scores differ?

For the same finite reference window, sample variance divides squared deviations by n − 1, while population variance divides by n. That changes the standard deviation used to scale the same distance from the mean.

Should the current observation be included in the z-score window?

Either definition can describe a different comparison. A lagged reference excludes the current observation; a current-inclusive window lets it affect the mean and standard deviation. Label the choice and use only information available at the stated calculation time.

Which z-score window length is best for trading?

There is no universally best length. The window changes the reference and the result. Choose it for a stated measurement and evaluation purpose, then evaluate any trading rule separately on untouched data with costs and execution assumptions.

What should a z-score calculation return when standard deviation is zero?

An unavailable result with a zero-dispersion explanation. Division by zero is undefined even when the observation equals the reference mean. Sample standard deviation also requires at least two reference observations.

Does a z-score of two imply a fixed probability or reversal?

No. Standardizing data does not make it normally distributed. A tail probability needs a justified model and treatment of estimated parameters and dependence. The score alone does not predict a reversal or demonstrate a trading advantage.

Sources and further checks

Use the current source for your exact instrument, account and platform. Referencing a general specification does not establish support for every TradeCopier workflow.

  1. NIST: measures of scale · Checked September 22, 2026
  2. NIST: autocorrelation · Checked September 22, 2026
  3. NIST: detection of outliers and z-scores · Checked September 22, 2026
  4. NIST: normal distribution · Checked September 22, 2026

Found an error? Send a correction with this page's address and a primary source. See our editorial standards for how we handle examples, claims and revisions.

Check the product workflow

Use these pages to check TradeCopier settings and connection requirements for your own setup.

Browse all resourcesCurrent resource: /learn/volatility-standard-deviation

Start Copying Smarter Today

Connect supported accounts with configurable sizing, risk controls, activity logs, and alerts.

Get Started Free