The Market Making Book

2b. Market Data: What You Feed the Machine

Klines, quote ticks, trade ticks, orders, and the order book are five different recordings of the same market. Before you can backtest a strategy, you must know which recording it needs — and why a market maker cannot survive on candles.

Part I · Chapter 2b

Chapters 1 and 2 described the market as a place — a book of bids and asks, painted into candles. This chapter describes it as data: the actual records a venue hands you and a backtester consumes. The distinction is not academic. Pick the wrong recording and your strategy either can't be tested or lies to you — the single most common way a first backtest fails is feeding it data that doesn't contain what the strategy needs to read.

There are five recordings of the same underlying reality. They differ in one axis above all: how much of the truth they keep, versus throw away.

The order book — the ground truth

Everything else is derived from this. The limit order book (Chapter 1) is the live, complete list of every resting order: every price level, the size waiting there, on both sides. As data, a book snapshot (or "L2 / depth" feed) is a record like:

book snapshot @ t bids: [ (97431, 2.4), (97430, 5.1), (97429, 0.8), … ] asks: [ (97433, 1.2), (97434, 3.0), (97435, 6.6), … ]

It is the richest and heaviest recording — the only one that shows depth (how much size rests away from the touch) and lets you reason about queue position (Chapter 7). A full-fidelity feed streams every add, cancel, and fill (the "L3 / MBO" — market-by-order — view). This is the truth from which klines, quotes, and trades are all just summaries.

diagram — one market, five recordings
The order book (left) is the source. A trade tick is emitted each time an order crosses and fills. A quote tick is emitted whenever the best bid or ask changes. A kline is a bucket that swallows a whole minute of trades and keeps only four prices and a volume. Reading left to right is reading detail being discarded — each arrow is information you can never recover downstream.

Quote ticks — the top of the book, live

A quote tick (best-bid-offer, "BBO") is a snapshot of just the top of the book: the best bid, the best ask, and the size available at each, stamped the instant either one changes.

quote tick ts=…, bid=97431.0 (2.4), ask=97433.0 (1.2)

It throws away depth beyond the touch but keeps the two numbers that define a tradeable market: what you can buy at and sell at, right now. Quotes update many times per second. The gap between bid and ask is the spread — and that gap is the market maker's entire revenue model. A quote tick is the smallest record that still contains a spread.

Why the market maker lives hereA market maker's job is to post a bid and an ask and earn the difference. To do that it must know, continuously, where the current best bid and ask are — so it can quote inside them, and so it knows whether its own resting quote would fill. That information exists only in quote ticks (or the full book). No amount of candle data contains it. This is why every market-making strategy is quote-driven or book-driven, and none run on klines alone.

Trade ticks — what actually executed

A trade tick is a single completed transaction: price, quantity, timestamp, and which side was the aggressor (did a taker lift the ask, or hit the bid?).

trade tick ts=…, price=97433.0, qty=0.15, side=BUY (taker lifted ask)

Trades are the finest-grained record of what happened — the raw stream that klines are literally built from by bucketing into intervals. They tell you the exact price and size of every fill and the direction of aggression (the basis of order-flow signals, Chapter 7). But note what a trade tick does not contain: the bid and ask that stood on either side of it. A trade tells you where a deal closed, not the live quotes around it. Trades ≠ quotes.

Klines (bars/candles) — a minute, compressed to five numbers

A kline — candlestick, bar — takes every trade in a fixed window and keeps only five numbers: open, high, low, close, volume (Chapter 2). Everything else about the minute is discarded.

1-minute kline (Binance CSV row) open_time, open=87648.21, high=87648.22, low=87632.74, close=87648.00, vol=4.08

This is the most compressed recording — and by far the most common, because it is small, free, and universally available. It answers "where did price go this minute?" perfectly. It cannot answer "what is the spread?", "how deep is the book?", or "was that fill a buy or a sell?" — those questions were averaged away the moment the bucket closed. A kline has no bid and no ask. That single absence is why the strategy you can build on it is directional, never spread-based.

Orders — your side of the conversation

The four above are what the market tells you. An order is what you tell the market — the fifth record, flowing the other way. A limit order ("rest 0.5 BTC to buy at 97430"), a market order ("buy 0.5 now"), or any of the richer types from Chapter 2 (post-only, IOC, stop). Your orders enter the same book as everyone else's; when one fills, the venue sends you back a fill (an execution report) — which, from the outside, looks exactly like a trade tick. The loop closes: you read quotes and book, you emit orders, the book emits trades, and the cycle repeats.

Which recording does your strategy need?

The practical question. Match the strategy's question to the recording that can answer it:

RecordingKeepsGood forCannot do
Order book (L2/L3)every level & size, both sidesmarket making, depth/queue signals, HFT, realistic fillsheavy; often paid; hard to store
Quote ticks (BBO)best bid, best ask, sizesmarket making, spread capture, trailing stops, realistic backtestsno depth beyond the touch
Trade ticksevery fill: price, size, sideorder-flow signals, tick strategies, better fill realismno live bid/ask; not a spread
Klines / barsOHLCV per intervaldirectional strategies (EMA, trend, mean-reversion), charting, most retail backtestsno spread, no depth, no side — useless for MM
Orders / fillsyour intents & executionsyour P&L, position, and execution auditdescribes you, not the market
The trap that breaks first backtestsA strategy silently assumes a recording. Feed it the wrong one and it doesn't error loudly — it under-trades or misfires. A textbook example: a trailing-stop strategy recomputes its stop from the live quote every tick; hand it only klines and it finds no quotes, rejects nearly every order, and "does nothing" — while a bracket strategy on the same klines works fine, because it fixes its stop from the bar's close. Same signal, opposite outcome, decided entirely by which recording each one reads.
interactive — the same 90 seconds, four ways
Viewingquote ticks
Records keptevery bid/ask change
Can see the spread?
Good for
One synthetic 90-second slice, redrawn as each recording would store it. The quote view shows the two lines a maker needs; the trade view shows individual fills colored by aggressor; the kline view collapses it all into a handful of candles. Toggle through them and watch information vanish — by the kline view, the spread the market maker trades has become invisible.

Where crypto data comes from — and what's free

Because this book's practical chapters use Binance (Chapter 12), one distinction is worth burning in now:

  • Klines and trades are free and historical. Binance's public archive (Binance Vision) publishes years of both. This is what you download to backtest a directional strategy.
  • Quotes and order-book history are not free from Binance. The archive contains no historical bid/ask. To backtest a market maker on real quotes you either pay a tick-data vendor, or synthesize quotes from bars/trades (a modeled spread — only as honest as the model).
  • Live quotes and the live book are free — over Binance's real-time WebSocket. So a market maker can paper-trade on free live quotes even though it cannot cheaply backtest on historical ones.
What you now knowFive recordings of one market, ordered by fidelity: order book ⊃ quote ticks ⊃ trade ticks ⊃ klines, plus your own orders flowing back. Directional strategies live happily on cheap klines; market making cannot — it needs the spread, which exists only in quotes and the book. The first rule of any backtest is to feed the strategy the recording it silently assumes. Part II now goes underground into the territory quotes and the book describe: why the spread exists, and what it must pay for.

On this page

GitHubGitHub repository