How to Algo

Tick Data vs Bars: What Resolution Your Algo Needs

Daily bars, minute bars, ticks or order-book depth? Match data resolution to the decision your algo makes, and see what a bar hides about stops and targets.

Part 2 of 20 · How to Algo · Previous: What a trading edge is · Next: Cleaning market data

The right data resolution is the one at which your algorithm makes its decisions and gets its fills. Not finer, because finer data costs time and money and adds new ways to be wrong. Not coarser, because a coarse bar silently answers questions it cannot see, and its answers are usually optimistic.

The rule we use: find the smallest time interval in which something your strategy cares about can happen, and make sure your data can see inside it.

This part covers the choice between daily bars, minute bars, ticks and order-book depth. It deliberately does not re-explain what Level 1, 2 and 3 data are; our L1 vs L2 vs L3 guide does that with storage numbers from our own archive.

Matrix of four algorithm types against five data levels, from daily bars to market-by-order, with each cell marked too coarse, right fit, useful or overkill

Four decisions, four resolutions

Multi-day trades decided at the close need daily bars. If the strategy computes a signal from daily closes, enters at the close and exits at a later close, a daily bar contains everything it uses. Our surviving RSI-2 dip-buying test on ES is an example: entry at the daily close, exit at a later close, no stop or target in between. Ticks add nothing except storage.

Intraday signals need minute bars. If the signal depends on what happened in the first thirty minutes of the session, or on a five-minute trend, you need bars at that resolution, built from real trades with the session boundaries in the right time zone (Part 3 is about getting those boundaries right).

Intraday stops and targets need ticks, or a conservative rule. The moment a strategy has a stop and a target that could both be hit inside one bar, the bar can no longer tell you what happened. You either need the tick path, or a rule that resolves every ambiguous bar against you.

Execution and microstructure need depth. Spread, queue, how many levels a large order walks through: that is order-book data. Most strategies need it only to measure costs honestly.

A useful corollary: a strategy that only works at a finer resolution than it was designed for is usually measuring something else. Our RSI-2 work on ES illustrates it from the other side. Compressing the multi-day trade into a single session on five-, fifteen-, thirty- and sixty-minute bars produced 100 parameter cells; only six were positive, none in both halves of the sample, and the five-minute version was negative before costs. The multi-day holding period was the edge. More resolution did not find a better version of it; it found a different, worse strategy.

What a bar hides

A five-minute bar on NQ might contain a few thousand trades. The bar reports four prices and a volume. It does not report:

  • whether the high came before the low,
  • whether price traded through your limit price or only printed it once,
  • how long price spent at any level,
  • whether the open was a gap through a level you wanted to buy at.

Each of those gaps in information has cost us money in a backtest.

Order of high and low. We tested a “rejection block” on NQ five-minute bars: a limit order inside a swept wick, with a target a multiple of the risk away. The first pass booked the target whenever the entry and the target fell inside the same bar. It showed +$85k at a 2R target, profitable in seven of eight years, with the holdout better than training. Forbidding a same-bar target fill, which is the honest treatment when you cannot see the path, turned it into −$65k. Same signals, same data, one convention.

Gaps through a level. On ES, a narrow-range breakout filled at the breakout level made $442.60 a trade. Filled at the worse of the level and the actual next price, it made $116.11. The difference, $169,125, was overnight gaps through a price nobody could have bought. The NR7 test shows the full table. Daily and intraday bars hide this equally well.

Touch versus trade-through. A bar’s low equal to your buy limit means price printed there. It does not mean your order was filled. Part 7 is entirely about this.

How often ambiguity matters, and why that is the wrong question

A common defence of bar-based testing is that ambiguous bars are rare. On our ES test of the EMA 9/20 pullback, bars that touched both stop and target affected only 1.4% of trades, and scoring them as wins moved the result from −$459,730 to −$301,387. Rare, and still $158k.

The better question is whether the ambiguous bars are random with respect to your signal. They usually are not. A tight bracket around a volatile entry makes ambiguous bars common exactly where the strategy trades. The rejection-block test had a nearby target, so the same-bar case was frequent and decisive. The ambiguity concentrates where your strategy lives.

The time scale tells you the resolution

A practical way to choose is to measure how fast price covers the distances your strategy cares about. On NQ during regular trading hours, we measured the median time until price first moves a given number of ticks from any starting point:

DistanceMedian time to first touch
±1 tickunder 0.1 second
±2 ticksabout 0.1 second
±4 ticksabout 0.5 second
±8 ticksabout 2 seconds

If your stop is eight ticks away, a one-minute bar contains thirty of those intervals. You cannot test that bracket on minute bars without a rule that resolves the ambiguity against you, and below a second the outcome is decided by latency rather than prediction. For a stop of eighty points the picture changes: minute bars plus a stop-first rule are adequate.

Store ticks even if you test on bars

You can always aggregate down. One line of code turns trades into minute bars, and from minute bars into daily ones. Nothing recovers the path inside a bar you only stored as OHLC.

The storage cost is lower than people assume. Seven years of NQ Level 1 data is about 4 GB compressed in our store. Ten-level depth for the same period is about 41 GB. Order-by-order data is a different scale: one NQ session in our market-by-order recording held 21,514,312 order events against 501,736 trades, about 320 MB against 2.2 MB of Level 1.

Log-scale bars of one NQ day on disk: Level 1 2.2 MB, Level 2 20 MB, Level 3 320 MB; each level up costs 9 to 16 times more, L3 is 145 times L1

Where to source historical ticks and what to check before you buy them is covered in our historical tick data guide. Two practical consequences:

  1. Keep ticks for everything intraday, build bars on demand, and record how each bar set was built (session boundaries, time zone, which trades were included).
  2. Insist on the aggressor side. A trade flagged as a market buy or a market sell by the exchange is the input for anything to do with order flow, and many datasets infer it rather than record it. Part 3 shows how one of our own historical sources turned out to contain quote updates labelled as trades.

Where depth earns its keep

Order-book data is expensive to store and easy to over-interpret. Its most valuable use for a retail algorithm is measuring what trading costs.

On ES, our depth recording shows the spread at one tick on 80.95% of top-of-book snapshots, with a mean of 1.542 ticks. The spread study breaks that down by time of day: very tight at the cash open, wide around the daily maintenance halt. That is a direct input into the cost model of every intraday strategy you test.

As a signal source, depth has been disappointing in every test we ran. Order-book imbalance on ES predicts the next mid move on 73 of 76 sessions, and the best-case move is worth $4.19 against a $12.50 crossing cost. The information is real, and it decays before a taker can collect it.

A decision table

Your strategyMinimum dataAdd when
Decides and trades at daily closesDaily barsNever needs more
Daily signal, intraday stopDaily bars plus minute bars for the stopThe stop is tight relative to the daily range
Intraday signal, market entry, wide bracketMinute bars from tradesBrackets get tighter than a few bars’ range
Intraday limit entries, tight bracketTicks with aggressor sideAlways
Order-flow features (delta, CVD, footprint)Ticks with exchange aggressor flagAlways; inferred side is a known error source
Cost modelling, execution researchTen-level depthBefore going live
Queue-position strategiesMarket-by-orderOnly with low-latency infrastructure

Checklist

  1. Write down the shortest interval in which your strategy decides, enters, or exits.
  2. Choose data that can see inside that interval.
  3. If you use bars below that resolution, resolve every ambiguous bar against yourself: stop before target, no target fill on the entry bar.
  4. Fill breakouts at the worse of the level and the next traded price, never at the level alone.
  5. Store ticks; build bars from them with documented session boundaries.
  6. Check that the aggressor side is recorded by the exchange, not inferred.
  7. Use depth to measure spread and slippage before you trust a cost model.

Resolution is only the first data question. The second is whether the data you have is correct, and it often is not in ways that look perfectly plausible. Part 3: Cleaning market data, timestamps, sessions and daylight saving time.

Frequently asked questions

Do I need tick data to backtest a trading strategy?

Only if decisions or fills happen inside a bar. A strategy that decides and trades at the daily close is fully described by daily bars. A strategy with a stop and a target a few points apart on a five-minute chart is not, because the bar does not tell you which of the two was touched first. That is when you need ticks, or at least a conservative rule for ambiguous bars.

Are 1-minute bars good enough for intraday backtesting?

For intraday signals with market entries and a wide bracket, yes, if the bars are built from real trades with correct session boundaries. For a tight bracket, no: on NQ during regular hours price first moves eight ticks from any starting point in a median of about 2 seconds, so a one-minute bar contains thirty of those intervals. Then you need ticks, or a rule that resolves every ambiguous bar against you.

What happens when a bar touches both my stop and my target?

The bar cannot tell you which came first, so the backtest has to assume. Resolve it against yourself: stop before target, and no target fill on the entry bar. On one NQ limit-order test, booking same-bar targets showed +$85k; forbidding them turned the same signals into −$65k.

Is daily data enough for a swing-trading algorithm?

If it decides and trades at daily closes with no stop or target in between, yes: a daily bar contains everything it uses. Our RSI-2 dip-buying test on ES is such a case. Compressing it into one session on intraday bars produced 100 parameter cells, only six positive and none in both halves of the sample.

When does an algo actually need order-book (L2) data?

For measuring costs, not for finding signals. Depth tells you the spread you will actually pay, how thin the book is around your stop and how often the market is wider than one tick. On ES our recording shows a one-tick spread on 80.95% of snapshots and a mean of 1.542 ticks.

Keep reading

How to Algo

Backtest vs Live Trading: Reconciling Every Trade

Why live trading drifts from the backtest: fills, latency, data gaps, rolls and code divergence. How to replay your live engine and reconcile trade by trade.

How to Algo

Cleaning Market Data: Timestamps, Sessions and DST

Timestamps in seconds vs microseconds, time zones, DST shifts, session boundaries and bad ticks: a futures data-cleaning checklist built from our own bugs.