Calculate the standard error of the Sharpe ratio: how far the measured Sharpe ratio may lie from the true one. A Sharpe ratio measured over a year of daily returns is an estimate, and roughly 95% of the time the true ratio lies within two standard errors of it.

The formulas are as follows, with SR the Sharpe ratio of one observation (the Sharpe ratio of get_sharpe_ratio without annualizing) and n the number of observations:

\[\text{"iid":}\;\; \text{SE} = \sqrt{(1 + \text{SR} ^{2} / 2) / n},\;\; \text{for normally and independently distributed returns (Lo, 2002, equation 9)}\] \[\text{"non\_normal":}\;\; \text{SE} = \sqrt{(1 - \text{γ₃} \cdot \text{SR} + ((\text{γ₄} - 1) / 4) \cdot \text{SR} ^{2}) / (n - 1)},\;\; \text{for independent but skewed and fat-tailed returns},\;\; \text{with γ₃ the skewness and γ₄ the non-excess (raw) kurtosis (Mertens, 2002; the standard error inside the Probabilistic Sharpe Ratio of Bailey and López de Prado, 2012)}\] \[\text{"gmm":}\;\; \text{SE} = \sqrt{\text{∂g} / \text{∂theta} \cdot \text{Σ} \cdot \text{∂g} / \text{∂theta'} / n},\;\; \text{for} \;\; \text{returns that may also be serially correlated and heteroskedastic} (\text{Lo},\; 2002,\; \text{Appendix}) . \;\text{With}\; \theta = (\mu,\; \sigma ^{2}) \text{and}\; g (\theta) = \mu / \sigma,\;\; \text{∂g} / \text{∂theta} = (1 / \sigma,\; - \mu / (\text{2sigma} ^{3})) \text{and}\; \text{Σ} \;\text{is the Newey and West} (1987) \text{long-run covariance of the moment conditions} (r_{t} - \mu,\; (r_{t} - \mu) ^{2} - \sigma ^{2})\]

Negative skewness, fat tails and positive autocorrelation all widen the standard error, so the same Sharpe ratio is then less certain. The standard error is on the scale of the Sharpe ratio of one observation; multiply by SQRT(252) to compare it with a Sharpe ratio annualized by SQRT(252) (exact for the “iid” and “non_normal” errors, a rescaling of the same estimate for “gmm”).

For more information about the method, see the following papers:

  • Lo, A.W. (2002). “The Statistics of Sharpe Ratios.” Financial Analysts Journal, 58(4), 36-52.
  • Mertens, E. (2002). “Comments on Variance of the IID Estimator in Lo (2002).” Working Paper, University of Basel.
  • Bailey, D.H., & López de Prado, M. (2012). “The Sharpe Ratio Efficient Frontier.” Journal of Risk, 15(2), 3-44.
  • Newey, W.K., & West, K.D. (1987). “A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix.” Econometrica, 55(3), 703-708.

Also known as: Sharpe ratio confidence interval, Sharpe ratio estimation error.

Sharpe Ratio Standard Error in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_sharpe_ratio_standard_error as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["SPY", "TLT", "GLD", "BTCUSD"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
    benchmark_ticker=None,
)

toolkit.performance.get_sharpe_ratio_standard_error(method="gmm")

Or, after setting up the Finance Toolkit MCP, ask:

How precise were the yearly Sharpe ratios of SPY, TLT, gold (GLD) and Bitcoin from 2021 to 2025, measured by their standard error?

Which returns:

Date SPY TLT GLD BTCUSD
2021 0.0586 0.0585 0.0635 0.0605
2022 0.0602 0.0567 0.0624 0.0589
2023 0.0635 0.0564 0.0609 0.0605
2024 0.0645 0.063 0.0617 0.0585
2025 0.0554 0.0611 0.0623 0.0634

Parameters

get_sharpe_ratio_standard_error accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe period to use for the calculation. Defaults to “quarterly” if the Toolkit is initialised with quarterly=True, otherwise “yearly”."weekly"
methodstr“iid”, “non_normal” or “gmm”, as described above. Defaults to “iid”."iid"
lagsintThe number of lags in the Newey-West covariance, only used when method=”gmm”. Defaults to None, which uses the Newey and West (1994) rule floor(4 * (n / 100)^(2/9)), 4 for a year of daily returns.2
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the standard errors. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share