How much memory does a bootstrap block preserve?
How to choose and challenge block length when resampling trading series, without confusing thousands of replications with new market evidence.

Four consecutive losses disappear when somebody shuffles a list. The same outcomes remain in the file, but now they alternate with gains. Cumulative profit may finish at exactly the same level while the decline along the way looks considerably more comfortable. Before interpreting the new curve, ask which mathematical operation produced that comfort.
The block bootstrap tries to preserve some temporal neighbourhood when resampling. It does not necessarily mix individual observations separately: it carries consecutive fragments together, then joins those fragments to construct other series. The choice of length determines which relationships survive inside each piece and which relationships are interrupted at the joins.
This guide focuses on that choice. We want to investigate Forex rules and their results without turning resampling into a confidence factory. A replication depends on the historical sample and the mechanism that constructs it. Its unfamiliar appearance does not make it an observation from another market.
The numbers, sequences and scenarios below are original hypothetical exercises. They do not describe Atlas, its robots or an empirical evaluation. We will examine how to frame a comparison, understand its limits and keep enough information to reconstruct it, without proposing a universal length or an automatic instruction to begin trading.
Define the question before resampling
Before choosing blocks, identify the quantity you want to study. It could be uncertainty around a mean, variation in a difference between systems, or the sensitivity of a path to other combinations of episodes. These questions are related, but they are not interchangeable. A method suitable for a mean is not automatically validated for every functional of an equity curve.
A bootstrap generates replications from a sample so that a statistic can be recalculated under a defined procedure. With time series, that procedure must account for relationships between observations. The arch time-series bootstrap documentation distinguishes fixed, circular and random-length blocks, and describes stationarity assumptions for the usual variants.
Our first specification might read: “Investigate variability in the mean daily net result of one fixed strategy version.” That sentence forces decisions about what counts as a day, how open positions are valued and what net means. It also identifies what we are not doing: we are not yet retraining models or reconstructing prices to run the rules again.
Another investigation might ask about maximum drawdown across reordered curves. Here, the order of episodes is central to the object of study. Capital, accumulation and valuation all need definitions. The chosen statistic determines what information a replication must preserve. Using the same library for both tasks does not remove that difference.
First write down which uncertainty the experiment represents and which uncertainties it leaves outside. If you only resample the results of a strategy that has already been selected, uncertainty from the parameter selection process does not magically reappear. If costs remain fixed, the replications do not automatically include surprises in future costs either.
A conditional result can still be useful. Discovering that a conclusion changes when you alter a plausible local dependence assumption deserves attention. The mistake would be to present that result as a complete distribution of future outcomes without explaining the historical sample, strategy version and conventions on which it depends.
Choose the unit before measuring length
A block of ten rows could mean ten minutes, ten trading days or ten trades scattered across several months. Length has no practical interpretation until you define the unit. For an irregularly trading robot, ten trades preserve neither a fixed duration nor necessarily comparable temporal exposure to another robot.
To investigate a portfolio, a table of results over common intervals can preserve the coincidence between systems. Each row represents the same period and each column represents one robot. Calendar alignment, position valuation and missing data must be resolved first. Filling missing information with zero is not equivalent to recording a confirmed period with no exposure.
If trades are your unit, describe the dependence you intend to preserve. Several trades may belong to the same partially closed position, or their exposures may overlap. Grouping the last five exits by closing time does not necessarily preserve the economic episode that generated them. A block can cut through shared exposure while keeping together outcomes from different conditions.
What you resample also matters: price levels, returns, residuals or monetary results. Joining blocks of price levels can introduce artificial jumps between the end of one fragment and the beginning of another. Those jumps are not market predictions. Resampling returns and reconstructing levels is a different operation, with different assumptions and its own consistency checks.
A table of previously generated results avoids reconstructing signals, but limits the question to that table. It does not necessarily represent what the robot would do if it experienced a new price sequence. Its entries might depend on indicators, existing positions or risk limits that no longer match the resampled ordering.
Resampling outcomes and rerunning rules are different experiments. The first can examine a conditional distribution of outcomes or accounting paths. The second requires a coherent market representation and an executor that updates its state. Keep both labels visible so that a polished chart does not make distinct operations appear equivalent.
Start with a unit you can audit. If a demo CSV lets you inspect certain conventions, use it within that educational scope; the existence of a file does not establish enough history for inference. Do not assume other packages contain data, or that any file can be redistributed or completed with invented observations.
What independent row shuffling destroys
Consider eight hypothetical outcomes in monetary units: four losses of two, followed by four gains of three. Their total is four. Starting from zero, the cumulative path falls to minus eight before recovering. Alternate a loss of two with a gain of three and the final result is still four, but the maximum drawdown between the observed points is two.
Here we have performed a permutation, not a bootstrap with replacement. That distinction is deliberate: the permutation preserves the exact collection of values, whereas resampling with replacement can repeat some observations and omit others. The example isolates the effect of ordering before introducing further changes in composition.
The mean cannot reveal that difference because it does not depend on order. A path statistic can. If actual losses tend to share conditions, separating them independently can alter precisely the property you are investigating. You do not need to claim every series has such dependence; you need to establish which structure matters for your question.
Looking only for linear autocorrelation in returns is not sufficient either. Dependence in magnitudes, costs or exposure states may not show up in the same way in the sequence of signs. Diagnostics should examine the variables that matter for the experiment, rather than one automatically generated chart chosen out of habit.
A block preserves neighbourhood, not causality. Keeping several losses together does not demonstrate that they share a mechanism, and separating them does not demonstrate independence. Resampling reflects an approximation to dependence. Explaining that approximation is part of the result, not a detail to hide behind the name of the technique.
A useful first check compares the historical series and its replications on a few properties chosen beforehand: run lengths, clustering of magnitudes, concentration by session or relationships between columns. If construction radically alters a necessary property, review the design before interpreting an improvement in the final statistic.
Construct a replication with visible blocks
Imagine twelve observations labelled A through L. With moving blocks of length four and no wrapping around the end, there are nine possible starting positions: A, B, C, D, E, F, G, H and I. Each start selects four consecutive neighbours. The block beginning at B contains B, C, D and E; the one beginning at G contains G, H, I and J.
To produce a replication with twelve positions, we can select three blocks with replacement. If their starts are B, G and B, the new sequence is BCDE, GHIJ, BCDE. The second appearance of BCDE is not a mistake: repeated fragments are part of the mechanism. Observations A, F, K and L do not appear in this particular replication.
The original order is preserved within each block. At the joins, however, E becomes adjacent to G, and J becomes adjacent to B. The procedure created those neighbourhoods. Block boundaries make visible your assumptions about which dependence can be interrupted. Those assumptions do not disappear when you draw a continuous curve.
If the observation count is not a multiple of the block length, you need a truncation or termination rule. For example, you can draw blocks until you exceed the target size, then retain only the required initial positions. Apply the same rule across replications and document it, particularly if you subsequently interpret durations.
A small audit does not require a sophisticated library. Save source indices alongside the replication and check that every segment described as a block reproduces consecutive neighbours. Verify the final size, the possibility of repetition and the absence of out-of-range accesses. These checks examine construction, not statistical suitability.
The number of available windows is not the number of independent episodes either. Our nine windows overlap and share many observations. An abundance of possible fragments does not increase the observed history. This distinction becomes important when a large table of replications looks much more informative than the small file from which it came.
We can use that sequence to check the edges without estimating any return. A appears only in window ABCD, whereas D appears in ABCD, BCDE, CDEF and DEFG. If each starting position has probability one ninth and we draw three blocks, the expected number of appearances of A is one third; for D it is four thirds. These are expectations across many draws, not requirements for each replication.
This calculation gives us a concrete code check. Generating a large collection of indices should approximate that asymmetry, allowing for random variation. If all identifiers appear equally frequently, perhaps the program is using circular blocks despite a label saying moving blocks. If a starting position never repeats, perhaps it is sampling without replacement. Neither check establishes validity for Forex, but both can reveal that the implemented mechanism differs from the mechanism being described.
Fixed, circular and random-length blocks
Moving blocks without wrapping have an easily visualised edge effect. A central observation appears in more fixed-length windows than an observation near the beginning or end. The arch documentation describes this undersampling of the edges. It is a property of the mechanism to understand, rather than proof that its results are always unusable.
The arch circular bootstrap allows a block to continue from the end back to the beginning. In our sequence, a length-four block starting at K would contain K, L, A and B. That convention treats positions symmetrically on a circle, but introduces a join between the last episode and the first.
Before using it, ask whether that join is reasonable for the objective. A historical sample that starts under one cost structure and ends under another does not become homogeneous when connected into a circle. Circularity is a resampling device, not a statement about economic continuity across the years included.
The stationary bootstrap of Politis and Romano uses random geometrically distributed block lengths in its discrete construction. One way to understand it is to continue with the next neighbour or start another fragment with a fixed probability. The supplied length represents an expected mean, not a compulsory size for every block.
In an educational example, a restart probability of one tenth gives an expected length of ten observations. The probability of retaining at least five consecutive observations in a block is nine tenths raised to the fourth power: 65.61 percent. This does not mean that exact proportion will appear in a small run.
| Variant | What is specified | What needs examination |
|---|---|---|
| Moving | Length of each block | Representation of the edges |
| Circular | Length and wrapping | Join from last to first |
| Stationary | Expected length | Restarts and size distribution |
The same numerical length does not describe the same experiment across variants. Comparing ten fixed rows with an expected length of ten requires retaining the definition of each method. Also save the software version, random-number generator and parameters: a short legend cannot reconstruct these choices on its own.
The tension between short and long blocks
A short block creates many joins and preserves few consecutive relationships. A long block carries more complete episodes, but leaves fewer pieces inside a replication of fixed size. There is no universally cautious direction: the effect depends on the series, the statistic and the dependence you need to approximate.
Imagine 240 observations and fixed lengths of six, twelve or twenty-four. Each complete replication uses forty, twenty or ten fragments, respectively. These are construction counts. They do not estimate the number of independent observations or directly measure precision, because the available blocks can overlap and share structure.
With a very short length, an extended run can be cut repeatedly. With a length approaching the full sample size, many replications can resemble rotations or relatively unvaried combinations of large pieces of the same history. Less variety does not invalidate every result, but changes what you are exploring and can limit the diagnostic.
Avoid selecting a length because it produces the narrowest interval or the most comfortable drawdown. That choice uses the desired result as its criterion. Block length needs a justification that precedes the conclusion. It can draw on the dependence horizon, diagnostics of the series and an appropriate statistical procedure, followed by sensitivity analysis.
Do not turn typical trade duration into an automatic answer either. If results are grouped by day, a position lasting a few hours can coexist with dependence lasting several days. Conversely, enormous blocks are not justified solely because one exceptional position remained open for a long time.
The practical question is which properties should survive inside a fragment for the exercise to make sense. Write down two or three, including their units and how they are observed. Then examine whether plausible lengths preserve those properties in an informative way. You do not have to guarantee a unique answer before proceeding.
What automatic selection can contribute
Automatic selection tries to replace an arbitrary choice with an explicit procedure. This can improve reproducibility, but the word optimal does not become a general guarantee. An objective, assumptions and an input series sit behind every optimisation. Changing any of them can change the interpretation of the estimated length.
Politis and White develop block-length estimators within a dependent-bootstrap framework. The later paper by Patton, Politis and White corrects expressions in that procedure. This methodological history matters when an implementation claims to follow the method: identify which version it implements.
The arch function optimal_block_length returns estimates for stationary and circular variants; with multiple input columns, it operates column by column. It does not automatically produce a universal length for a whole portfolio, all its risks and every statistic. Its output needs a decision consistent with the intended analysis.
Suppose it returns different values for two robots’ results. Always choosing the smaller value for convenience would be an additional convention. Always choosing the larger would also be an additional convention. You can investigate alternatives, but do not attribute a rule you added yourself to the function.
An automatic recommendation is an input to the design, not a certificate about the future. Save the input series, its missing-data treatment and the returned value. If you convert the output to an integer, document the rounding rule. For an expected-length method, check whether the interface supports non-integer values before imposing an unnecessary restriction.
Keep failure diagnostics too. A sample that is too short, constant or malformed may not contain enough information for the routine. Do not automatically replace a failure with a convenient length and subsequently describe the result as statistically selected. You can use an educational value, provided its origin is explicit.
For an initial investigation, an automatic estimate accompanied by a few reasoned nearby lengths is often more explanatory than an isolated number. Nearby must be defined in the units of the study and need not mean symmetric distances. The purpose is to see whether the conclusion depends on a fragile choice, not to find the value that rescues it.
Dependence between robots travels with the blocks
Several Forex systems can share movements, trading hours and costs. Resampling each column with independent indices destroys some of that coincidence. The resulting portfolio can appear diversified because the procedure separated losses that originally occurred together. Such a change must be an explicit hypothesis, not an unnoticed side effect.
One way to preserve observed coincidence is to resample multivariate rows with the same indices. Each block carries the aligned columns together. This preserves contemporaneous relationships within sampled rows and some temporal relationships inside blocks, although it does not automatically solve regime changes or missing-data problems.
Consider four fictional days. A produces two, minus one, three and minus two units; B produces one, minus two, two and minus one. The differences A minus B are one, one, one and minus one, with a mean of half a unit. If you study that difference, using the same days for both systems preserves the paired comparison you just defined.
Resampling A and B separately answers a different question, because it can compare a favourable day for one system with a different day for the other. That is not necessarily an error in every context, but it would be inconsistent with an objective of retaining shared conditions. The joint unit must match the joint dependence.
An actual portfolio also has shared capital and margin constraints. Summing columns of individual results assumes those exposures could coexist in the way recorded. If a portfolio manager changes sizes or rejects entries because of constraints, a simple resampled sum may not represent an executable account.
Now imagine a rule that suspends new entries after two consecutive losses. Subsequent opportunities in the original history may never have been executed. If you reorder only completed trades, you do not have outcomes for every opportunity the new sequence would allow the system to accept. The robot’s state and the set of available observations change together. You cannot reconstruct missing information by assigning it the result of another convenient trade.
This limitation does not force you to abandon every investigation of the table. It requires describing the observations as outcomes generated under a particular policy whose selection mechanism also matters. An extension would need signals and enough market data to simulate that policy again, including costs and constraints. Requesting additional input detail answers a defined question here; accumulating files without identifying the necessary state does not solve the problem.
An initial study can remain a descriptive comparison of series, provided it says so. To examine state-dependent portfolio decisions, you must reconstruct the policy and its constraints along each path. Blocks help design variation in inputs; they do not replace the account model or the definition of what survives when episodes are joined.
Resampling does not make the calendar homogeneous
A series can change its distribution over time. Trading hours, liquidity, data coverage or robot rules may change. Mixing all fragments as if they were interchangeable introduces a substantive assumption. Having the same number of columns in every row does not turn the historical sample into a homogeneous population.
In Forex, weekend closure and session transitions require attention. A block of rows can preserve observation order without preserving elapsed time. If you later calculate an annualised rate or a duration, decide what the replication’s calendar means. Do not assign fictional dates without examining the consequence.
The paper by Dowla, Paparoditis and Politis on the local block bootstrap addresses locally stationary processes and describes using blocks close in time. It is a reference for a particular methodological modification. It does not imply that choosing nearby fragments resolves every structural break or abrupt market change.
In an applied investigation, begin by showing which periods and conventions are being mixed. If cost calculation changed, you may need to reconstruct a consistent series or separate the questions. If a robot has a new version, joining its results to earlier ones requires clarification: are you studying an updating policy or a fixed strategy?
Segmentation is also a research decision. Cutting the sample exactly where a statistic improves can introduce another selection step. Preserve the reason for the boundary and distinguish externally known information from decisions made after observing results. Segmentation can clarify a problem without eliminating all uncertainty.
One useful alternative is to treat a change as a separate scenario: observe what happens under each convention and which relationships a mixture stops preserving. This does not automatically assign probabilities to future regimes, but can reveal how much of the conclusion depends on treating the past as interchangeable.
More replications reduce computation noise, not missing history
Generating more replications usually stabilises the numerical approximation to the chosen procedure. It adds no observed episodes and does not repair an unsuitable construction. If the historical sample contains no example of a relevant condition, repeating its fragments thousands of times does not guarantee that condition will appear realistically.
Suppose eighty out of one thousand hypothetical replications exceed a loss threshold. The observed fraction is eight percent. Under independent draws from the same fixed mechanism, an approximation to the Monte Carlo standard error of that fraction is √[0.08 × 0.92 / 1,000] ≈ 0.00858: approximately 0.86 percentage points.
This calculation describes simulation noise around the conditional mechanism. It does not include uncertainty about its validity, parameters or relationship to the future. Four times as many replications halve that approximate error if the conditions remain unchanged. Numerical precision can increase without increasing economic credibility.
Percentiles require similar care. A drawdown percentile across constructed paths is not automatically a valid confidence bound for future losses. The estimand, assumptions and interval method must support that interpretation. The arch documentation on confidence intervals distinguishes several constructions; they do not all behave identically for a given statistic.
Avoid reporting decimals that suggest precision the design cannot support. Keep the replication count, seed and, where appropriate, a numerical stability check. If two seeds produce material differences, increase or review the calculation before developing explanations about the robot itself.
The fraction of replications meeting a condition belongs first to the resampling experiment. Turning it into a different claim requires further justification. Naming it precisely lets you use the diagnostic without promising a future probability that you have not estimated.
Prepare sensitivity analysis that does not choose for you
A comparison of lengths can be specified in a small table before seeing its results. Define the series, statistic, method and reason for including each length. Hold the remaining choices constant and record the seeds or indices needed to reproduce each experiment. The objective is to detect dependence on design, not declare the most pleasant scenario the winner.
For example, investigate a central length motivated by a diagnostic and two others that preserve less and more neighbourhood. There is no need to invent universal values. If conclusions change sign or scale, retain that disagreement as a result. Averaging incompatible scenarios can hide precisely the sensitivity you have discovered.
Inspection should include what the replications look like, not only their final summary. Examine runs, joins, representation of extreme episodes and consistency between columns. Check the edges and the final truncated piece as well. A plausible statistical output can still come from incorrect indexing.
If you use AI to write the resampling code, start with the A–L sequence and require source indices in the output. Ask it to explain the block crossing the end, the meaning of expected length and the truncation rule. A verifiable example should precede the large historical sample. Do not accept a convincing curve as proof that the windows were constructed correctly.
Then prepare a decision record: which lengths were proposed initially, which were added and why. Expanding an investigation after noticing an anomaly can be sensible, but distinguish that expansion from the original comparison. Traceability makes it possible to see which work was diagnostic and which decisions responded to results.
This connects to parameter robustness, although here the parameter belongs to the resampling procedure. Do not confuse stability of a trading rule with stability of a tool used to examine it. Both can matter, and neither replaces the other.
Deliver the conclusion together with its conditions
A useful report begins with the series and scope: unit, period, system version, costs and statistic. It then identifies the method, lengths, replication count and edge treatment. Readers should be able to determine what travelled together and which relationships were broken without having to infer those choices from a chart.
A precise conclusion can say a measure changes little across the investigated lengths, under one mechanism and one historical sample. Another can say that retaining longer episodes materially changes the distribution. Neither needs an invented guarantee of robustness to be useful. Both help identify which uncertainty deserves examination next.
Do not replace a conditional conclusion with the label “passes Monte Carlo”. That phrase erases the choice of what was resampled, which dependencies were retained and what criterion was applied. It can also suggest that all ways of generating scenarios are equivalent. The name of a family of methods does not identify a reproducible test.
Retain negative findings and scenarios where construction stops being defensible. If long blocks reveal that the sample offers very few distinct episodes, shortening them until the table stabilises does not remove that limitation. You may need to wait for data, change the question or accept that the exercise remains descriptive.
Finally, check how units accumulate. A loss of ten percent followed by a gain of ten percent turns one hundred into ninety, then ninety-nine. Two fixed monetary outcomes of minus ten and plus ten instead return one hundred to one hundred. Confusing those conventions can change drawdown even when the blocks and their indices are correct. The report must state whether it preserves monetary amounts, returns or a sizing rule recalculated from available capital.
As a final exercise, take a short sequence and draw two replications with different lengths. Mark the created joins, count repeated observations and explain which property you wanted to preserve. Then write one claim the replications permit and another they do not. If you can justify that distinction, you have begun using the bootstrap as a research tool rather than decoration for a curve.



