Skip to content
GetProfitable
Search
Dictionary

Expanding window

A window that starts at the first observation and grows with each new data point, so every estimate uses all history to date.

Expanding windows are the correct default for anything that should use all available evidence without seeing the future: a cumulative mean, a running percentile rank, a normalisation constant applied to live data.

The danger with the alternative is subtle. If you standardise a whole series using its full-sample mean and standard deviation, every early observation has been scaled using numbers from the future. That is look-ahead-bias hiding inside a preprocessing step, and it is one of the most common silent bugs in research code.

Example: ranking today's volume against the expanding history of volumes is legitimate; ranking it against the whole dataset including next year is not, and can flatter a backtest by a surprising amount.

Related: rolling-window, look-ahead-bias, anchored-walk-forward

Educational only, not advice. Spotted an error? Post in Site Feedback.