Start freeSign in
Research/Glossary/Rolling window

Rolling window

Reference

A rolling window is a fixed-length subset of observations that is moved forward through a time series one step at a time.

A rolling window is a fixed-length subset of observations that is moved forward through a time series one step at a time. At each step, the same calculation is repeated on the observations inside that window. This converts a single summary statistic into a time-varying path of values.

Sonar’s fundamentals research page defines a rolling window as a fixed-length span that moves through a dataset so a measure can be recomputed repeatedly across consecutive subsets of the data. The key idea is that the window length stays constant while the window location changes. If the window is 20 trading days, the first calculation uses days 1 through 20, the next uses days 2 through 21, then days 3 through 22, and so on.

A moving average is a simple example. With daily prices and a 20-day rolling window, the 20-day moving average on a given date is the average of the most recent 20 daily prices in that window. As the window advances by one day, the oldest price drops out, the newest price enters, and the average is recomputed. The same mechanism applies to rolling volatility. With a 20-day window, volatility at each step is computed from the returns inside the current 20-day subset, producing a volatility series that changes through time rather than a single full-sample estimate.

This matters because many properties of financial data are not constant across the sample. A full-period average or volatility gives one number for the entire history, but a rolling calculation shows how that measure evolves. The result is a path-wise view of the statistic, which can reveal changes in level, stability, or dispersion that a single summary number hides.

In Sonar’s backtest-overfitting audit workflow, rolling-window style analysis is used to examine statistics along the path of a strategy rather than only at the full-sample level. The purpose is to evaluate how reported metrics behave across consecutive segments of the backtest and to inspect their variation through time. This path-wise framing is useful in overfitting audits because a strategy can look strong when compressed into one aggregate statistic while showing instability or degradation across rolling segments.

The same logic connects to Sonar’s discussion of the deflated Sharpe ratio. The glossary page explains that performance statistics should be interpreted with attention to selection effects, non-normality, and the uncertainty around estimated metrics. Rolling-window analysis complements that perspective by showing how an estimated statistic changes across repeated fixed-length samples of the backtest path instead of relying on one point estimate from the entire record.

In practice, the mechanism is straightforward. Choose a window length, select the statistic to compute, move the window through the data in order, and store each result at its corresponding time index. The output is a new time series of the statistic. That is why a rolling window is best understood as a method for turning one static measurement into a sequence of measurements aligned with time.

Covered in depth in the Strategy research fundamentals pillar hub.

Apply this and the related checks to your own results with the Backtest Overfitting Audit.Open the audit
ShareXLinkedInFacebookEmail