Detecting Order Book Walls with Conditional Queue Distributions
Summary
The document asks how to identify unusually large bid or ask queues, or “walls,” in a limit order book. It considers simple rules based on quantities above the mean or median, price zones, and comparisons between large queues near the best bid and ask. These methods need thresholds and may flag distant orders or create false signals.
The proposed approach models the historical distribution of a queue’s size conditional on the sizes of the neighboring queues. A trader can compare the observed queue with that conditional distribution, using a quantile or empirical probability, then apply a threshold to flag unusual size. This makes the comparison sensitive to local book conditions instead of relying on one global size cutoff. The document offers this as direction inspired by the queue-reactive model; it provides no implementation details, performance evidence, or guidance on choosing thresholds. Large displayed quantities may also be deceptive, a concern raised in the question but not resolved by the answer.
Key ideas
- A single mean or median cutoff can misclassify queues when order sizes vary across price levels.
- Comparing large queues near the best bid and ask requires a chosen proximity range and threshold.
- A queue can be assessed against its historical size distribution conditional on its neighboring queues.
- Conditional quantiles or empirical probabilities can provide a basis for flagging unusually large queues.
- The suggested method does not explain how to handle deceptive displayed orders or validate alerts.
Tags
Full text
# How to identify buy walls and sell walls from a limit orderbook?
# How to identify buy walls and sell walls from a limit orderbook?
I am trying to get notified of buy walls and sell walls from a limit orderbook and I had a couple of ideas and would appreciate some insight into these
- Take the mean quantity and anything above the mean quantity would classify as a wall, problem would arise with extremely low price buys and high price sells
- Take the median quantity, anything above median would do the same as 1
- Divide the price range into 10% zones, compute the median in each zone and the largest quantity above the mean/median in the zones closest to the price would form a wall. This would trigger some fake walls though
- Measure the largest quantities in descending order within a specified proximity from current highest bid and lowest ask and have a condition where if the bid quantity > sell quantity by a threshold T we get a buy wall and vice-versa for a sell wall. Are there better algorithms that I am not considering. This seems to be a problem similar to identifying candlestick chart patterns such as head and shoulder which needs threshold values to identify the formation
Are there any better mechanisms to identify buy and sell walls from an orderbook programatically? Some direction is appreciated
UPDATE 1 I could find nothing on IEEE xplore for orderbook https://ieeexplore.ieee.org/search/searchresult.jsp?newsearch=true&queryText=orderbook some direction/advice/snippet would be super appreciated
## Answer by lehalle (score 1)
https://quant.stackexchange.com/a/77834
I suggest to get inspiration from Huang, Weibing, C-A L, and Mathieu Rosenbaum. "Simulating and analyzing order book data: The queue-reactive model" Journal of the American Statistical Association 110, no. 509 (2015): 107-122.
Estimate the distribution of the size of each queue $Q_k$ (in "average trade size") conditioned by the sizes of the queues at its left $Q_{k-1}$ and at its right $Q_{k+1}$. Now you can
- observe the sizes of $Q_{k-1}$ and $Q_{k+1}$
- get the historical distribution $d\mu(Q_k|Q_{k-1},Q_{k+1})$ given these two values
- take a quantile or get the empirical probability to observe the effective $Q_k$
- threshold on it.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.