Queue position and fill probability
A limit order earns the spread only if someone trades against it. "The limit order book" showed that orders resting at one price are served in the order they arrived. This lesson asks what that rule means for a single resting order: how long it waits, how likely it is to trade within a given time, and what it costs to move it. The answers decide whether a market maker (a trader who keeps buy and sell quotes in the book) actually collects the spread it quotes.
Throughout, a buy limit order of shares rests at the best bid, and shares are queued in front of it. Time is measured in minutes and sizes in shares.
The queue at a price
Under price–time priority, orders at the same price trade in the order they arrived, first in, first out. A new order joins at the back of the queue. Your order trades only after every share ahead of you has either been executed or cancelled. What counts is shares, not orders: 1,260 shares ahead of you is 1,260 shares ahead, whether they sit in three orders or in thirty.
Take a best bid of 99.97 with shares ahead of your . Nothing happens to your order until has fallen to zero, and then it fills gradually as further sell volume arrives.
What moves you forward
Only two things shrink the number of shares ahead of you:
- Market sell orders hit the bid. They are matched against the front of the queue at the best bid, so each one removes its size from . Market buy orders trade at the ask and leave your queue alone.
- Cancellations ahead of you. A trader who changes their mind removes their shares and everyone behind moves forward.
New orders arriving at 99.97 join behind you and cancellations behind you do not matter, so neither changes .
Waiting time
Suppose sell volume hits the bid at a constant shares per minute and cancellations ahead of you remove shares per minute. The queue ahead then shrinks linearly:
Your first share can trade once reaches zero. Solving for gives the waiting time:
With , and the combined rate is 400 shares a minute and minutes.
Real flow is not constant: market orders arrive at random times with random sizes. The formula still gives the typical wait, but individual waits scatter around it. Over the time the removed volume has a standard deviation of , where is the variance of sell volume per minute (defined in the next section). Dividing a quantity in shares by the speed converts it to minutes:
In the example , so the standard deviation is about 1.1 minutes: an order that is expected to wait 3.15 minutes can easily wait two or five.
Fill probability
To go from an average wait to a probability, model the sell volume itself. Market sell orders arrive at random times at rate per minute, and each has an independent random size with mean and second moment . Over a horizon of minutes the number of orders is Poisson with mean , and the total volume is the random sum
Its mean follows from . For the variance, add the variance of the sizes and the variance of the count:
This is the same structure as the walk in "Random walks and Brownian motion": a sum of independent steps whose mean grows with time and whose standard deviation grows with .
Cancellations ahead remove another shares. The first share of your order trades if the volume plus the cancellations reach shares. When many orders arrive, the sum is close to normal, and with the standard normal distribution function
If sizes are exponential, . Orders of mean 100 shares arriving 3 times a minute give 300 shares of sell volume per minute and , a standard deviation of 245 shares.
The wait is about , and the fill probability is with the shares still to be removed, in standard deviations of the sell volume. The normal approximation is rough when only a few orders arrive per minute.
With only three orders a minute the sum is skewed and the normal approximation is coarse: simulating the same queue many times gives a fill chance of about a third rather than 40%. Many orders per minute make it accurate.
The figure draws the queue as blocks of 100 shares, with your order outlined and the front on the right, and plots the one-minute fill probability against the number of shares ahead. Start at the defaults: 1,260 shares ahead, an expected wait of 3.15 minutes, and a one-minute fill probability of only 0.02%. Press Simulate 1 minute to see random sell volume and cancellations eat the front, and press it again until your order starts to fill. Then raise the sell volume to 600 per minute, or drag the starting position to 400, and watch the curve and the readouts change.
- Shares ahead
- 1260
- Expected wait
- 3.15 min
- Fill within 1 minute
- 0.02%
- Filled
- 0 of 400 shares
Losing priority
Priority is built only by waiting. Changing the price means cancelling and entering a new order at the other level, which joins the back of that queue. Raising the size usually does the same, because the extra shares cannot jump ahead of orders that arrived before them. Cancelling and re-entering at the same price also sends you to the back.
Suppose you have waited two minutes in the example, so 460 shares are ahead and the remaining wait is minutes. If 500 shares have joined behind you meanwhile and you now cancel and re-enter, you start again with 960 shares ahead and a wait of minutes. This is why makers leave resting orders alone unless the market gives them a reason to move.
Which fills you get
Your bid trades only when sellers push through the level, and an order at the back trades only after all the volume ahead of it has been consumed. So the fills you receive are not a random sample of market conditions. Orders near the front fill in quiet trading; orders at the back fill when selling is heavy and persistent, which is also when the price is more likely to keep falling after the fill. A queue position is therefore a choice about both how often to trade and in what conditions.
Summary
- Orders at one price trade first in, first out; your order trades only after all shares ahead are executed or cancelled.
- Market sells at the bid and cancellations ahead are the only things that move you forward, giving an expected wait of about .
- Sell volume over a horizon is a compound Poisson sum with mean and variance , which gives .
- Cancelling and re-entering sends you to the back of the queue, so moving an order costs the time already waited.
- Back-of-queue fills tend to come when selling is heavy, so the price often continues to fall afterwards.