Skip to content

Research notes

Crypto bootstrap confidence intervals: how uncertain is the mean?

Enumerate all 27 resamples of a tiny return sample, then audit the assumptions behind a confidence interval for a backtest mean.

An ivory bowl and five shallow trays hold ivory and lime pebbles beneath ivory caliper arms on a black background.
Illustration for research notes; examples in this article are educational.

A crypto backtest bootstrap confidence interval estimates sampling uncertainty in a specified statistic, such as mean daily net return, by recalculating it on resamples of observed data. Its credibility depends on the sampling unit, dependence model and interval method. It is not a probability band for the next trade, a guarantee of positive returns or a drawdown forecast.

A reported average of +0.1% per day is one estimate from one history. An interval asks how precisely that history identifies an underlying mean under stated assumptions. Before pressing a resample button, write down which mean you intend to estimate.

Name the quantity before drawing samples

Mean net return per completed trade and mean daily portfolio return answer different questions. Trades can last different lengths of time, overlap and use different amounts of capital. An average trade return does not automatically describe an investor's calendar-day experience.

For a daily portfolio question, start with a consistent daily return series that includes the relevant holdings and cash. Define fees, slippage and funding treatment before resampling. Include flat days when they belong to the stated portfolio process. Dropping them changes the target to something closer to an active-day mean.

Also freeze the strategy, evaluation dates and return definition. Choosing a favorable period after inspecting intervals changes the research procedure. Rolling and expanding backtest windows explain how retaining or dropping older observations changes the history available to an estimate. Neither window choice makes incompatible market conditions automatically exchangeable.

Resampling changes the estimate; shuffling does not

In an ordinary independent bootstrap, draw observations with replacement until the resample has the original sample size. Calculate its mean, repeat, then use the distribution of those means to construct the chosen interval. Some original observations appear several times; others are absent. SciPy's bootstrap documentation describes this procedure and distinguishes percentile, basic and bias-corrected and accelerated, or BCa, intervals.

A pure permutation contains each observation once. Reordering a fixed list leaves its arithmetic mean unchanged. It can change a path-dependent quantity such as maximum drawdown. The existing Monte Carlo trade-sequence example demonstrates those path effects; here the target is uncertainty in the mean, not an alternative equity path.

Do not turn a histogram of individual returns into a confidence interval for their mean. The bootstrap distribution must contain the recalculated statistic from each resample.

Enumerate a complete toy bootstrap

Consider three invented daily net returns: −2%, +1% and +4%. Their arithmetic mean is (−2 + 1 + 4) / 3 = +1%. These numbers are teaching inputs, not market observations or KLINEO results. Temporarily assume independent draws from their empirical distribution, each source value having probability one third.

Draw three values with replacement. There are 3^3 = 27 equally likely ordered resamples. For example, (−2, −2, +4) has mean 0%, while (+1, +1, +4) has mean +2%. Grouping all 27 resamples gives:

Resampled meanNumber of ordered resamplesCumulative count
−2%11
−1%34
0%610
+1%717
+2%623
+3%326
+4%127

The counts sum to 27. Their weighted mean is +1%, matching the original estimate. For this illustration, define a percentile as the smallest value whose cumulative share reaches the requested probability. The 2.5th percentile is −2% because 1/27 already exceeds 2.5%; the 97.5th is +4% because 26/27 is below 97.5%.

An illustrative two-sided 95% percentile construction therefore produces [−2%, +4%]. Discreteness makes its enclosed bootstrap mass exceed 95%. Different software quantile conventions can interpolate between values, so record the convention. Enumerating the possibilities removes simulation noise; it does not make three observations adequate evidence for a real mean.

The interval crosses zero despite the positive sample mean. That is a reason to retain uncertainty about the sign under this toy model. It is not an estimate that the next day has a 95% chance of landing between these endpoints. The source sample cannot supply a −20% shock that it never contained.

Dependence changes the resampling model

Independent observation draws discard adjacency. Suppose losses occur in clusters during a persistent liquidity disruption. Drawing each day separately can break that structure and misrepresent the variability of an average. Positive dependence can make an independent bootstrap too reassuring; other dependence structures can change uncertainty differently.

Block methods draw consecutive observations together, retaining their order within each sampled block. The arch time-series bootstrap documentation distinguishes fixed-length circular blocks that wrap across the sample end from fixed-length moving blocks that do not. The wrap rule changes which observations can be neighbors and how often edge observations are sampled.

The original stationary-bootstrap research studies standard errors and confidence regions for weakly dependent stationary observations. That scope is a condition to assess, not a property granted by labeling a series “crypto returns.”

Choose a method and block length with the dependence and research question in view. Show sensitivity to several justified lengths rather than retaining the narrowest interval. Very long blocks leave few distinct pieces of history; very short blocks may miss relevant persistence. A block method cannot make a structural regime change disappear or reconstruct an unobserved crisis.

For a portfolio, keep synchronized assets together when their shared shocks matter. Independently resampling each coin can remove the very dependence that the portfolio mean needs. Validate timestamps and missing periods with the backtest data-quality worksheet before choosing blocks.

Interpret the interval as a procedure

A nominal 95% confidence level describes repeated-sampling coverage under the procedure's assumptions: across repeated samples and interval calculations, approximately 95% of the intervals would contain the fixed population parameter. It does not assign a 95% probability to the fixed mean being inside the particular computed interval. NIST's confidence-interval explanation sets out this repeated-sampling interpretation.

Nominal coverage is a target, not an observed success rate for your backtest. Short samples, tail behavior, dependence and model changes can undermine it. An interval above zero also remains conditional on the cost and execution model; missing fees are not repaired by statistical precision.

A realistic failure is an export containing only identical zero returns because a data join failed. Resampling produces no variation. That apparent precision is a property of the supplied values. SciPy also documents that a degenerate bootstrap distribution can yield undefined BCa endpoints. Investigate the input and report the failure rather than converting a zero-width or undefined result into certainty.

Keep an interval decision record

Use this worksheet before comparing reports:

RecordExample of a declared choiceWhat it prevents
Target and unitsArithmetic mean of daily net portfolio returnsConfusing daily and trade averages
Frozen inputEvaluation dates, venue, strategy version and file hashQuietly changing the underlying sample
Sampling modelCircular blocks with a stated length and wrap ruleTreating “bootstrap” as a complete method
Interval constructionTwo-sided percentile, 95%, named quantile ruleComparing incompatible endpoints
ComputationResample count, generator, seed and software versionsUntraceable numerical differences
Sensitivity and limitsRetain results for justified alternate block lengthsSelecting a reassuring method afterward

More resamples reduce numerical noise within the selected model; they do not add historical observations. The random-seed reproducibility guide explains what must be saved to repeat a randomized run. Reproducibility and statistical validity remain separate questions.

Finally, bootstrapping the winning strategy's returns does not replay the search that selected it. Keep rejected variants in the backtest trial ledger. A precise interval around a selected, biased sample can still support a misleading conclusion.

Method and limits

This article is AI-assisted educational synthesis of the linked primary documentation, with an original exhaustive arithmetic example and proposed worksheet. All 27 toy resamples were enumerated. No market return dataset, empirical confidence coverage or KLINEO bootstrap feature was tested. Compare product-specific evidence with the published backtest methodology; this statistical workflow is not a claim of product support.

Keep the context with the example.

Each worked example is illustrative, with its sources and assumptions in the article. Read our editorial standards for authorship, verification and corrections.