Bar Aggregation and Resampling Choices
How you group raw trade and quote data into bars — by clock time, by volume, or by trade count — changes the statistical properties of your data before you've written a single line of strategy logic.
Prerequisites: Point-in-Time Data
Raw market data arrives as a stream of individual trades and quotes, each with its own timestamp. Almost no strategy works directly with that stream — instead, it gets grouped into "bars," each summarizing open, high, low, close, and volume over some chunk of the stream. The default choice, a bar every fixed clock interval like one minute, feels so natural that it's easy to forget it's a choice at all, and not a neutral one. During the first ten minutes after the open, hundreds of trades might occur; during a quiet lunchtime stretch, a one-minute bar might contain two trades or none. Fixed-time bars are built from data that arrives at a wildly uneven rate, which means the statistical properties of the bars — their volatility, their information content — vary through the day in ways that have nothing to do with the market and everything to do with the clock.
The alternatives
Volume bars close a bar after a fixed amount of shares or contracts have traded, so a bar during the busy open might last ten seconds while a bar during a quiet stretch might last twenty minutes — but each bar represents roughly the same amount of trading activity. Dollar bars do the same thing using traded notional value, which is more stable than volume when a security's price changes a lot over the sample period. Tick bars close after a fixed number of individual trades. All three adapt to the market's own pace rather than the clock's, and research comparing them has generally found that volume- and dollar-based bars produce returns closer to a normal distribution and with more stable variance than time bars — a genuinely useful property if the strategy or its statistical tests assume anything about the shape of the return distribution.
A concrete case
Consider building a mean-reversion signal on one-minute bars for a stock around an earnings announcement. In the minute right after the release, thousands of trades might occur and the price can move several percent; an hour later, the same one-minute window might see a handful of trades and barely move. A signal tuned on the quiet-period bars will be systematically miscalibrated for the volatile period, because a "one-minute move" means something completely different in the two regimes. Rebuilding the same data as volume bars instead means each bar reflects a comparable amount of market activity throughout the day, so the signal sees a more consistent unit of "how much happened" regardless of when it happened.
What this means in practice
The choice of bar type is a modeling decision, not a data-formatting detail, and it should be made deliberately and documented alongside the rest of the strategy's assumptions. Time bars remain the right choice when a strategy is inherently about calendar time — end-of-day rebalancing, or anything tied to scheduled events — but for signals meant to capture market microstructure or momentum, activity-based bars are usually a better match for how information actually arrives.
Time-based bars sample the market unevenly because trading activity is uneven; volume, dollar, and tick bars instead sample by a fixed amount of market activity, which tends to produce more statistically well-behaved data for strategies sensitive to distributional assumptions.
Related concepts
Practice in interviews
Further reading
- Lopez de Prado, Advances in Financial Machine Learning, ch. 2