Playground
Order Book Replay Visualizer
Drop a Level-2 CSV and watch the order book reconstruct tick by tick. Animated depth bars, best bid/ask, spread over time. Runs in your browser. Free.
- Inputs
- Paste + configure
- Runtime
- 1–15 s
- Privacy
- Client-side · no upload
- API key
- Not required
- Methodology
- Open →
Load a Level-2 snapshot CSV
Wide format: one row per timestamp, columns for timestamp, bid_pxN/bid_szN, ask_pxN/ask_szN. Up to 20 levels per side supported. Everything runs in your browser — nothing is uploaded.
What this tool visualizes
Every snapshot in your CSV is rendered as two depth bars — green for bids (below mid), rose for asks (above mid). Bar length is proportional to size at that level. The dashed line is the mid.
The timestamp and quoted spread (absolute + basis points) update as you replay. Load the demo to see the shape; then bring your own L2 export from any of the vendors in theTCO calculator.
How to use
Step-by-step
- 1
Upload an ITCH or PITCH feed dump (NASDAQ or Cboe), or pick a pre-loaded sample day.
- 2
Set the replay speed (real-time, 10x, 100x, or paused step-through) and aggregation level (tick / 1ms / 100ms / 1s).
- 3
Watch the book reconstruction at the chosen aggregation. Step through events to inspect specific moments.
- 4
Drop in your strategy's hypothetical order at any point and observe the simulated fill, queue position, and slippage.
- 5
Compare with naive backtest assumptions (instant fills at midquote). The gap is your strategy's execution risk.
For agents
Use in an agent
Same math, same result shape as the UI above — as a static ES module. No HTTP request, no auth, no rate limit.
import { compute } from "https://aifinhub.io/engines/order-book-replay.js"; Contract: /contracts/order-book-replay.json Full agent guide →
Glossary references
Terms used by this tool
Questions people ask next
FAQ
Where does the historical order book come from?
The tool reads ITCH (NASDAQ) and PITCH (Cboe) feed dumps as documented on the methodology page. Polygon and Databento both sell historical level-2 data in these formats. The replayer reconstructs the limit order book from message sequences and steps through it tick-by-tick.
Can I replay any symbol?
Only symbols on exchanges that publish ITCH/PITCH feeds (NASDAQ, NYSE, Cboe). Off-exchange and dark-pool fills don't appear in the feeds. The methodology page lists which exchanges are supported. Symbols traded primarily off-exchange (some small-caps) have incomplete order-book reconstruction.
What's the time resolution?
Microsecond timestamps on the source data. The replayer can step at any aggregation: tick-by-tick (every message), 1ms, 100ms, or full-second snapshots. Tick-by-tick is appropriate for HFT-level analysis; coarser aggregations are faster for strategy prototyping.
Does it model exchange-specific protocols?
Yes for the listed exchanges. The methodology page documents the differences (e.g., NASDAQ's price-time priority vs. Cboe's price-display-time-priority, different cancel-replace conventions). Cross-exchange routing is not modeled — orders are simulated against a single venue's book.
How big a dataset can I replay?
1 trading day for SPY is roughly 100M messages and 5GB compressed. The tool supports streaming replay (no full load into memory) but is limited by your machine's I/O. Multi-day replay across many symbols is meaningful only with a serious dataset pipeline.
Related deep dive
All articles →Read further
Long-form context behind the tool output.
- Methodology · Opinion·7 min
Almgren-Chriss Optimal Execution: A Worked Example
Almgren-Chriss optimal execution on a 250k-share sell: the permanent and temporary impact decomposition, the mean-variance frontier, and a 19.40-bps cost.
Read - Methodology · Opinion·11 min
Execution Simulation: Slippage and Impact
The math of market impact — why it scales as the square root of trade size, when linear impact dominates, and the fix that keeps backtests honest.
Read - Pillar · Guide·10 min
Execution Simulator: 50k Shares at 10% Participation
Engine returns 12.59 bps total cost ($2,833 on $2.25M notional) for a 50k-share buy at 10% participation. Splitting across days makes impact worse.
Read
Used in
Decision workflows that use this tool
Goal-driven flows that bundle this tool with adjacent ones.
Complementary tools
Users of this tool often explore
Pair Trading Cointegration Tester
Paste two price series. Engle-Granger cointegration test: OLS hedge ratio, Augmented Dickey-Fuller on residuals, Ornstein-Uhlenbeck half-life, z-score.
Correlation Matrix Visualizer
Paste a multi-asset returns CSV. See the Pearson correlation heatmap, condition number, average absolute correlation, and eigenvalue concentration.