Identify what trades, quotes, depth and bars measure, then preserve the timing, units and market scope needed to use them in quantitative research.
Market data
Market data is recorded information about trading activity and market conditions, including transaction prices and sizes, bid and ask quotes, displayed depth, and trading status. It supplies the observations behind signals, risk estimates and execution decisions. A quant needs to know what each field measures and when it became available: a column called “price” is too ambiguous to define a tradable strategy.
Here, market data means information generated by or derived from trading markets. A research dataset may also combine company accounts, economic releases and other inputs; those have their own publication and revision histories.
Start with the question, then choose the record
Record or view
What it tells you
What it leaves open
Trade
A transaction occurred at a reported price and quantity, subject to the source’s conditions and corrections
Whether the same price remains available
Best bid and ask
The highest displayed buying price and lowest displayed selling price within a defined scope, with their quoted sizes
Liquidity beyond those sizes, hidden interest and the price when your order arrives
Displayed depth
Buying and selling quantities at additional price levels in the supplied order book
Undisplayed liquidity, other venues and future cancellations
Open, high, low, close and volume bar
A summary over a specified interval and eligible set of transactions
The complete sequence of trades and quote changes inside that interval
Market-status message
A source-defined state such as a halt or an auction phase
A guarantee that a particular order will be accepted or filled
The last traded price and the midprice are therefore different variables. A bar’s close also needs its interval, session and eligibility rules. No amount of decimal precision recovers information discarded by aggregation.
“Level 1”, “Level 2” and similar labels are shorthand, not a complete data dictionary. Check whether the product supplies individual orders or quantities aggregated by price, how many levels it carries, and whether it sends snapshots, incremental updates or both.
Build the snapshot your system actually saw
Consider an original synthetic capture of a stock on one venue. Prices are USD per share, quantities are shares, and times are milliseconds after a common origin. For this illustration the source and local clocks share that origin without clock error, and each received message is decoded and made usable immediately.
A trade at 98 occurs at time 10 and reaches the system at 12. Quote A has event time 20 and receipt time 24: the best bid is 99 for 400 shares, and the best ask is 101 for 80 shares. The system makes a decision at 25.
The usable snapshot contains that trade and Quote A. Its midpoint is
m=299+101=100USD per share.
The quote has been in the local system for 1 ms; its source event is 5 ms old. Those ages measure different things. Neither the trade at 98 nor the midpoint at 100 establishes a purchase price. Even the displayed ask shows only 80 shares: a proposed purchase of 100 shares exceeds it by 20 shares, before considering cancellation or competition.
Synthetic single-venue capture: trade at 98 has event and receipt times 10 and 12 ms; Quote A at 99 bid and 101 ask has times 20 and 24 ms. Both are available at decision time 25 ms. Quote B at 100 bid and 102 ask has times 23 and 28 ms and is unavailable. Quote A displays 400 bid shares and 80 ask shares; its midpoint is 100 USD per share.
Original synthetic stock capture, in USD per share and milliseconds after one common clock origin. The decision uses messages received by 25 ms. Quote B’s earlier event time does not make its later arrival available in the decision snapshot.
Quote B changes the quote to 100 / 102, with event time 23 but receipt time 28. Its midpoint of 101 enters the system 3 ms after the decision. A historical file ordered by event time can place it before the decision. Using it as an input to that decision introduces look-ahead bias.
For record i, a necessary availability condition is ri≤d, where ri is local receipt time and d is decision time. The record must also have been decoded and made available to the strategy; receipt is only the earliest possible boundary. If a historical dataset omits capture or availability times, its event timestamps alone cannot establish the exact information set of a particular live system.
Trades, Quotes and Market State develops causal trade-and-quote joins and quality flags. Its public preview outlines the lesson; the full lesson requires membership.
Keep the feed’s meaning attached to its values
An instrument’s listing venue is not necessarily the scope of the data. It may trade in several places. A direct venue product and a consolidated product can contain different observations because they cover different activity. For example, NYSE’s consolidated-tape overview describes the collection of trades and quotes from participating markets into consolidated streams. A dataset’s venue coverage, message rules and consolidation policy should accompany its prices.
The update rule matters just as much. Coinbase Exchange’s Level2 documentation describes a starting book snapshot followed by updates. The update’s size replaces the quantity at that price level; it is not an amount to add. A zero size removes that level, and the documented update time is the trading engine’s event time. These are specific channel semantics. Applying a generic “add every size” rule would construct a fictitious book.
For each research extract, retain enough context to interpret and reproduce it:
Identity and units: instrument identifier, currency, price scale, quantity units and contract multiplier where relevant.
Scope and time: venue or consolidation coverage, session, timezone and the meaning of every timestamp.
Integrity and revisions: sequence or message identifiers where supplied, gap flags, corrections, cancellations and the version of any cleaning rule.
Transformations: raw versus adjusted prices, bar boundaries, trade filters and the date or version of the extract.
Missing data should stay distinguishable from a zero price or zero volume. Carrying an old quote forward does not refresh it. A large price move can be real; removing every spike can delete the market conditions a strategy most needs to survive. Preserve the raw observation alongside a cleaned value and the reason for changing it.
The APIs lesson provides a small offline JSON example for validating price and currency fields. It has a public preview and requires membership for the full lesson. A successful request is only the start: the returned data still need an economic meaning, a clock and a defined scope.
Sources
Rishi K. Narang, Inside the Black Box: A Simple Guide to Quantitative and High-Frequency Trading, 2nd ed. (Wiley, 2013), Chapter 8, “Types of Data”, pp. 135–136, and “Cleaning Data”, pp. 139–141: price-related records, timeliness, missing values, units and the danger of rejecting genuine price moves.
NYSE — Consolidated Tape: collection of participating markets’ trade and quote reports into consolidated streams.
Coinbase Exchange — WebSocket Channels, “Level2 Channel”: snapshot and update messages, replacement-size semantics, zero-size removal and event-time definition.