← Back to Guides

Midquote Done Right: Snapshot Timing and Data Quality

December 28, 2025 Execution

Why midquote matters

Midquote is the reference price used in execution cost metrics like effective spread. If your midquote is wrong, everything derived from it becomes noise.

This is why midquote done right is mostly about timing and data quality, not about math.

Definition and the one rule you must follow

Midquote is the midpoint between the best bid and best ask at a specific moment.

Rule #1: bid and ask must come from the same snapshot.

If bid is from one moment and ask from another, you create a fake midpoint and you will mis-measure costs.

Snapshot timing: what is the moment

There are three common choices. Pick one and stay consistent across your whole dataset.

Option A: trade submission time (recommended)

Capture bid and ask at the moment you submit the order.

• Best for measuring the cost you accepted when you clicked.

• Works well with both market and limit orders.

Option B: first fill time

Capture bid and ask at the timestamp of the first fill.

• Better if your system cannot reliably capture quotes at submit time.

• Can understate the cost you intended to take if quotes moved against you between submit and fill.

Option C: closest quote snapshot within a fixed window

Capture the nearest bid and ask snapshot within a window like 200ms or 1s around submission.

• Useful if quotes arrive asynchronously and you need a rule for alignment.

• You must store the window and the matching rule, otherwise the metric is not reproducible.

Common data quality problems

Stale quotes

A quote can look valid in the UI but be stale in logs if updates are infrequent. Stale quotes distort midquote and therefore effective spread.

• Red flag: the same best bid and ask persist for unusually long periods while trades still occur.

• Fix: store quote timestamps and filter out snapshots older than a threshold in analysis.

Asynchronous bid and ask updates

Sometimes bid and ask update at slightly different times. If you record them separately, you can accidentally combine mismatched values.

• Fix: store a single top of book snapshot event, not separate bid and ask events.

Spread widening regimes

Near major news or close to expiration, markets can enter spread widening regimes. Midquote is still valid, but it moves more and the book becomes thinner.

• Fix: treat this as a market condition, not as a logging bug. Also log liquidity signals like market depth.

How midquote interacts with fills

Effective spread uses your actual execution. If you have multiple fills, compute your execution price using VWAP first, then compare VWAP to the midquote.

• If you do not have per-fill data, you will not be able to measure execution cleanly.

A practical logging checklist

If you want cost metrics that are defensible, log these fields for every trade:

• trade_id

• timestamp_submit

• top_of_book_bid, top_of_book_ask

• timestamp_quote_snapshot (the timestamp for both bid and ask together)

• order_type (market or limit)

• fills (price and quantity per fill)

• execution_price (or enough data to compute it)

• market_id and any market condition tags you track (thin, wide, etc.)

Sanity checks you can run

These checks catch most broken midquote datasets quickly:

• bid should always be less than or equal to ask

• midquote should always be between bid and ask

• if you see negative spreads, your snapshot join is wrong

• if midquote jumps but bid and ask do not, you have a timestamp or unit mismatch

Takeaway

Midquote is simple, but capturing it correctly is not optional. Treat midquote as a first class data object: one snapshot, one timestamp, consistent alignment with trade events.

Related

Effective Spread vs Quoted Spread: What's the Difference

Effective Spread Calculator: How to Use It

Midquote

Effective Spread

VWAP

Market Depth