Abstract
In the rapidly evolving world of financial markets, understanding the dynamics of limit order book (LOB) is crucial for unraveling market microstructure and participant behavior. We introduce ClusterLOB as a method to cluster individual market events in a stream of market-by-order (MBO) data into different groups. To do so, each market event is augmented with six time-dependent features. By applying the K-means++ clustering algorithm to the resulting order features, we are then able to assign each new order to one of three distinct clusters, which we identify as directional, opportunistic, and market-making participants, each capturing unique trading behaviors. Our experimental results are performed on one year of MBO data containing small-tick, medium-tick, and large-tick stocks from NASDAQ. To validate the usefulness of our clustering, we compute order flow imbalances across each cluster within 30-minute buckets during the trading day. We treat each cluster's imbalance as a signal that provides insights into trading strategies and participants' responses to varying market conditions. To assess the effectiveness of these signals, we identify the trading strategy with the highest Sharpe ratio in the training dataset, and demonstrate that its performance in the test dataset is superior to benchmark trading strategies that do not incorporate clustering. We also evaluate trading strategies based on order flow imbalance decompositions across different market event types, including add, cancel, and trade events, to assess their robustness in various market conditions. This work establishes a robust framework for clustering market participant behavior, which helps us to better understand market microstructure, and inform the development of more effective predictive trading signals with practical applications in algorithmic trading and quantitative finance.
Introduction
In high-frequency trading, the Limit Order Book (LOB) is the primary source of information. However, traditional analysis often treats all orders as a monolithic "flow." In reality, the market is a heterogeneous mix of participants—ranging from high-frequency market makers to informed institutional traders—each with different motivations and execution styles.
The challenge is that market data is usually anonymous; we don't know which "buy" order belongs to a bank and which belongs to a retail trader. This paper addresses the gap in market microstructure analysis by asking: Can we identify different types of trading behavior using only publicly available market-by-order (MBO) data, and can that segmentation lead to better predictive signals?
The ClusterLOB Framework
The authors introduce ClusterLOB, which processes a stream of market events (adds, cancels, and trades) through a multi-step pipeline:
- Feature Engineering: Each order is augmented with six time-dependent features, including the available volume at the order's price, the time elapsed since the last mid-price change, and the cumulative volume on the same and opposite sides of the book.
- Normalization: To ensure the model works across different stocks and time periods, they use a forward-rolling normalization (using the 100 most recent orders). This prevents "look-ahead bias" and accounts for changing market volatility.
- Clustering: They apply the K-means++ algorithm to group orders into $K=3$ clusters.
- Behavioral Labeling: To make the clusters interpretable, they correlate each cluster's Order Flow Imbalance (OFI) with different return horizons:
- Directional ($\phi_1$): High correlation with contemporaneous returns (orders that move the price immediately).
- Opportunistic ($\phi_2$): High correlation with future returns (traders who anticipate short-term price moves).
- Market-making ($\phi_3$): Low correlation with price moves (liquidity providers minimizing inventory risk).
Experimental Setup
The study utilizes one full year (2021) of LOBSTER data, which reconstructs the NASDAQ limit order book from ITCH messages. The dataset covers 15 stocks across six sectors (e.g., Technology, Finance, Health Care). Stocks are grouped by tick size (Small, Medium, and Large), as tick size fundamentally changes how participants interact with the book. The first six months of 2021 were used for training and clustering, while the final six months served as the out-of-sample test period.
Key Results and Insights
The authors evaluated their strategies using the Sharpe Ratio (SR) and Profit and Loss (PnL) per trade. The results demonstrate significant outperformance over traditional methods:
- The "Opportunistic" Alpha: The most significant finding is that the "opportunistic" cluster ($\phi_2$) consistently provides the strongest predictive signal for future returns. While directional traders move the price immediately, opportunistic traders seem to anticipate where the price is going next.
- Sharpe Ratio Improvements: In small-tick stocks (like NVDA or GOOG), the opportunistic cluster-based strategy achieved a Sharpe Ratio of 1.34, compared to just 0.596 for the standard unclustered benchmark. For large-tick stocks, the improvement was even more dramatic: the cluster-based strategy hit a Sharpe Ratio of 1.548, while the unclustered benchmark produced a negative return (-0.013).
- Behavioral Stability: Despite the chaotic nature of financial markets, the clusters remained remarkably stable. The features that defined a "market maker" in the training set were nearly identical to those in the test set six months later.
- Tick-Size Sensitivity: The effectiveness of clustering varies by stock type. Directional strategies are more effective for medium-tick stocks with wider spreads, while opportunistic signals shine in large-tick stocks where quote granularity is lower.
Conclusion and Future Work
ClusterLOB establishes a robust framework for clustering market participant behavior, helping to filter out "noise" from market makers and focus on "informed" flow. While the current study fixed the cluster count at $K=3$, future work could explore adaptive clustering that updates in real-time as market dynamics shift. Additionally, expanding the feature set to include queue position or order duration could further refine behavioral profiles. This methodology holds practical applications for algorithmic trading and quantitative finance across various high-frequency limit order books, including Cryptocurrency and Forex markets.
Summary updated