Introduction

Order books (lists of buy and sell orders at different prices) contain rich microstructure information. Large sell orders near the bid suggest sellers, large buy orders near the ask suggest buyers. Imbalances between bid and ask side predict short-term price direction. Visualizing order book as heat maps—images showing order density at different price levels—enables using computer vision (convolutional neural networks) to analyze order book dynamics and predict price movements.

Order Book Heat Map Construction

Order book heat map: vertical axis = price levels relative to midpoint, horizontal axis = time, color intensity = order size or number. A time series of order books becomes a series of heat maps showing how the book evolves. This visual representation is ideally suited to CNNs.

Alternative representations: volumetric order book (3D: price × depth × time), optical flow (showing movement of orders from level to level), or molecular visualization (representing orders as particles). Different representations emphasize different aspects of order book dynamics.

Training CNNs on Order Book Images

CNN architecture: 2D convolutions process spatial structure (price levels), temporal convolutions process time dimension. ResNet or VGG-style architectures work reasonably. Alternative: 3D CNNs handling spatiotemporal data directly (price × time × features).

Prediction task: given last T seconds of order book (as sequence of heat maps), predict next-second price movement (up/down/flat). Train CNN on historical order books paired with subsequent price movements. With sufficient training data (millions of orders), CNN learns patterns predictive of price direction.

Empirical Performance

Testing CNN on intraday order book (5-second order book history predicting next second):

  • CNN on raw heat maps: 52-54% directional accuracy (slightly better than random)
  • CNN on engineered features (order imbalance, depth): 55-57% directional accuracy
  • Ensemble CNN + classical microstructure models: 58-61% directional accuracy

CNNs on order book images provide modest edge (2-3% better than random), but not breakthrough performance. Order books are highly competitive markets; predictability is limited.

Challenges in Order Book Analysis

Challenge 1: Data Volume and Latency. Order books update thousands of times per second. Storing and processing this data at scale is computationally demanding. Real-time inference (needed for trading) requires GPU resources and optimized code.

Challenge 2: Overfitting to Market Microstructure. Order book patterns are highly specific to market conditions, time of day, and underlying volatility. A model trained on quiet periods might fail during stress. Cross-validation and careful out-of-sample testing are essential.

Challenge 3: Non-Stationarity. Trading algorithms adapt. As automated strategies become prevalent, order book patterns change. A model trained on 2020 order books might not work in 2024. Constant retraining and monitoring are necessary.

Interpretability: Understanding What CNNs Learn

CNNs on order books are black boxes. What patterns do they learn? Visualization techniques (activation maps, saliency maps) help understand which parts of the order book the CNN focuses on. Some patterns are interpretable (large orders at bid/ask), others are opaque.

Comparison to Classical Microstructure Models

Classical approaches: use order imbalance (buy volume - sell volume), depth ratios, or other hand-crafted features. These approaches are interpretable and often competitive with CNNs. CNN advantage: learns feature interactions automatically. CNN disadvantage: requires more data and more computation.

Practical Deployment

For real-time trading, CNN-based order book analysis must run on exchanges' colocation servers with minimal latency. This is expensive and only worthwhile for high-frequency traders with significant AUM. For lower-frequency traders, classical microstructure models are simpler and often as effective.

Regulatory Considerations

Order book data is public but closely guarded in practice. Exchanges provide limited historical access; real-time feeds are expensive. Some jurisdictions regulate use of order book data. Consult compliance before implementing order book analysis strategies.

Conclusion

CNNs applied to order book heat maps enable learning order book patterns predictive of price movements. Performance is modest (2-3% edge over random), reflecting competitive market microstructure. CNNs offer advantages over classical methods in automatically learning feature interactions but require more computational resources and careful validation against overfitting. Most practical for high-frequency traders with infrastructure for real-time deployment. For others, simpler classical microstructure models are often more effective.