MES One-Minute Bars with Delta: Build Them from Tick Data
Rebuild 1,380 MES one-minute bars for January 2, 2025, add delta from ask_sz − bid_sz, and check every OHLCV row against the published file.
Delta is ask-side volume minus bid-side volume
MES one-minute bars contain OHLCV and trade count, but no delta. The underlying tick files have bid_sz and ask_sz, which are executed volumes classified at bid or ask. You can calculate trade-side delta from those fields and aggregate it in the same minute buckets as the published bars.
trade_delta = ask_sz - bid_sz
bar_delta = sum(trade_delta for each retained trade in the minute)
The result is a signed number of contracts. Positive delta means more classified executed volume at ask than bid during that minute; negative delta means the reverse. It says nothing about resting liquidity, order-book depth or the number of buyers and sellers. Every trade has both sides. The classification records which side initiated execution under the feed’s method.
For the worked example, use MES continuous tick files and annual one-minute bars. Current monthly MES bars are available with a free verified account, but bar samples alone cannot supply delta. Full historical tick files require a paid plan.
The fields measure trades, not the book
| Field | Meaning | Common misreading |
|---|---|---|
| ts | Feed-receive timestamp in UTC | Assuming it is a bar-ending or exchange event timestamp |
| price | Trade price; adjusted in continuous files | Using it as a guaranteed fill |
| volume | Contracts represented by the record | Counting every row as one contract |
| bid_sz | Executed volume classified at the bid | Resting bid quantity |
| ask_sz | Executed volume classified at the ask | Resting ask quantity |
| trade_count | Trades represented by the record | The dataframe row count |
There are no historical best-bid or best-ask price columns. Do not invent quote prices from size fields or call the result full-depth footprint data. This is a trade-side volume series.
Read one day, not 172 million rows
This example reads January 2, 2025 from the 2025 continuous MES tick file. Predicate pushdown selects the day before a dataframe is created, avoiding a load of roughly 172 million annual rows for a small test. The aggregation then reproduces published OHLCV and adds delta.
from datetime import datetime, timezone
import pandas as pd
import pyarrow.parquet as pq
start = datetime(2025, 1, 2, tzinfo=timezone.utc)
end = datetime(2025, 1, 3, tzinfo=timezone.utc)
columns = ["ts", "price", "volume", "bid_sz", "ask_sz", "trade_count"]
ticks = pq.read_table(
"cme.mes.tick.continuous.2025.parquet",
columns=columns,
filters=[("ts", ">=", start), ("ts", "<", end)],
).to_pandas()
# Published bars exclude zero-volume price records.
ticks = ticks.loc[ticks["volume"] > 0].copy()
assert ticks["ts"].is_monotonic_increasing
assert ticks["bid_sz"].add(ticks["ask_sz"]).eq(ticks["volume"]).all()
# Signed 64-bit integers avoid unsigned subtraction and cumulative overflow.
ticks["delta"] = (
ticks["ask_sz"].astype("int64") - ticks["bid_sz"].astype("int64")
)
bars = ticks.set_index("ts").resample(
"1min", label="left", closed="left", origin="epoch"
).agg(
open=("price", "first"),
high=("price", "max"),
low=("price", "min"),
close=("price", "last"),
volume=("volume", "sum"),
trade_count=("trade_count", "sum"),
delta=("delta", "sum"),
).dropna(subset=["open"])
assert bars["volume"].sum() == ticks["volume"].sum()
assert bars["delta"].sum() == ticks["delta"].sum()
print(bars.head().to_string())
The volume identity is deliberately strict. If another window fails it, stop and inspect the feed records rather than hiding the discrepancy inside delta. The final assertions check that aggregation conserved contracts and signed delta, catching accidental row filtering and bad bucket logic.
The first five rebuilt bars
For this UTC day, the code produces 1,380 nonempty bars. These are the first five, taken from the actual files:
| UTC | Open | High | Low | Close | Volume | Trades | Delta |
|---|---|---|---|---|---|---|---|
| 00:00 | 6343.50 | 6344.25 | 6341.25 | 6341.50 | 410 | 334 | -134 |
| 00:01 | 6341.75 | 6342.50 | 6340.25 | 6340.50 | 334 | 227 | -60 |
| 00:02 | 6340.50 | 6340.75 | 6337.00 | 6337.00 | 418 | 297 | -122 |
| 00:03 | 6337.00 | 6337.75 | 6335.00 | 6336.00 | 528 | 358 | -74 |
| 00:04 | 6335.75 | 6336.75 | 6331.75 | 6331.75 | 692 | 448 | -274 |
All 1,380 rebuilt OHLCV rows match the published January 2 one-minute file exactly. Verify that relationship in code rather than trusting a visual comparison:
published = pd.read_parquet(
"cme.mes.bars.1m.2025.parquet",
columns=["ts", "open", "high", "low", "close", "volume", "trade_count"],
filters=[("ts", ">=", start), ("ts", "<", end)],
).set_index("ts")
pd.testing.assert_frame_equal(
bars[published.columns], published,
check_dtype=False, check_exact=True,
)
Once OHLCV agrees, delta shares the same timestamps and membership rules. That is safer than downloading bars and delta from different places and using a nearest-time join, which can pair different sessions, bar conventions, roll methods or trade-classification rules.
Negative delta is not a short button
In the 00:00 bar, delta is -134 while price opens at 6343.50 and closes at 6341.50. More bid-classified volume accompanied a two-point drop. That observation does not explain why price moved, whether large passive sellers were replaced, or what happened next.
Rising price with negative delta can be informative too, but labels such as absorption need a defined hypothesis and evidence. You might test whether a large negative-delta bar with little downward progress behaves differently from one with a large range. That requires thresholds chosen on development data, later out-of-sample evaluation, realistic execution and a comparison with simpler predictors. Delta alone is not a strategy.
Volume measures activity; delta measures imbalance between two classified subsets of it. Dividing delta by bar volume can help compare periods with different activity, although low-volume bars make the ratio unstable. Report the denominator beside the ratio.
bars["delta_fraction"] = bars["delta"] / bars["volume"]
# Inspect bars[["volume", "delta", "delta_fraction"]] together.
Cumulative delta starts wherever you say it does
A cumulative sum depends on its starting point. Two platforms can calculate the same per-minute delta and show different cumulative values because one starts at a Chicago session open, another at UTC midnight, and another at the beginning of the loaded chart.
Choose the session definition before comparing cumulative delta. Published daily bars use a Chicago 17:00 boundary with daylight-saving handling, not UTC midnight. Derive a matching session key with a timezone-aware calendar and apply it to every bar. A fixed seven- or eight-hour subtraction will not work throughout the year.
# Only after constructing a validated Chicago-session column:
bars["session_cumulative_delta"] = (
bars.groupby("session")["delta"].cumsum()
)
The snippet deliberately leaves session construction explicit. For a simple UTC-day study, group by bars.index.date and call the result UTC-day cumulative delta, not exchange-session delta.
Rolls change contract activity, not delta arithmetic
The example uses continuous MES ticks so adjusted prices match the published continuous bars. Additive roll adjustment changes price level, not executed bid and ask sizes, so delta remains a sum of those sizes. The roll still matters: the source contract changes and activity can move between contracts around the transition.
For contract-specific execution or liquidity research, build bars from dated MES ticks instead. Those prices are raw and symbol identifies the contract. Do not append dated-contract delta to adjusted continuous bars unless OHLCV and roll provenance also match.
Keep ts, OHLCV, trade count, delta and a source identifier in the final output. Parquet preserves UTC and integer types. Save the code and original inputs so delta can be rebuilt rather than treated as an unexplained vendor field. The dataset schema documentation defines the inputs, and the Parquet validation guide covers CSV conversion and reproducibility. Download the required inputs from the MES historical data page.