The Claude Quant PlaybookDownload ebookDownload ebook

t-statistic for a strategy's mean return

intermediateStatistics6 of 10

The sample mean divided by its estimated standard error. Because the volatility is estimated from the same data, it follows a t distribution rather than a normal.

Build a trading system with Claude.Download ebook

01The formula

the t-statistic
the average daily return
the sample standard deviation of daily returns
the number of days
Student's t distribution with n − 1 degrees of freedom
the null hypothesis: the true mean return is zero
the daily Sharpe ratio, x̄/s

02See it move

03Where it is used

04Why traders use it

It links the Sharpe ratio to evidence: t is the daily Sharpe times √n. A high Sharpe over a short history is weak evidence; the t-statistic says exactly how weak.

05Worked example

An average daily return of 0.10% with volatility 1.0% over 250 days gives t = 1.581. The 5% critical value is 1.970, so the p-value of 11.51% does not reject 'no edge', even with an annualised Sharpe of 1.59.

06How it is built

  1. Estimate the standard error with the sample volatility: .
  2. Divide: .
  3. Because is noisy, has fatter tails than a normal: it follows when the returns are normal and .
  4. Rewrite it as : the daily Sharpe ratio times .

07The common mistake

Testing many strategies and reporting the best t. If you try 20 ideas, one of them will usually show t above 2 by luck alone.

08In Python and LaTeX

import numpy as np
from scipy.stats import t as tdist
xbar, s, n = 0.001, 0.01, 250
t = xbar / (s/np.sqrt(n))
print(round(t, 3), round(tdist.isf(0.025, n-1), 3), round(2*tdist.sf(abs(t), n-1), 4))
t = \frac{\bar{x}}{s / \sqrt{n}} \sim t_{n-1} \ \text{under } H_0: \mu = 0, \qquad t = \widehat{\text{SR}}_{\text{daily}}\sqrt{n}

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.