Queue Position Models for Limit Order Backtesting
Summary
This code describes queue position models for estimating when a simulated limit order may fill. The conservative model starts with the displayed quantity ahead at the order’s price and advances only as trades occur there. A probability based alternative also accounts for reductions in displayed depth, estimating how much of a cancellation or other depth decrease came from ahead of versus behind the order. It tracks trades between depth updates to avoid counting their quantity twice.
Several probability functions use power or logarithmic transforms of quantity ahead and behind to estimate the share of a depth decrease that advances the order. The excerpt also includes a Level 3 market-by-order model interface and FIFO-related behavior, plus tests involving order additions, deletions, and fills. These are simulation assumptions for backtesting, not guarantees of actual queue placement or fill outcomes. The excerpt is partial, and it does not provide empirical validation showing which model best matches a venue.
Key ideas
- A conservative queue model moves an order forward only when trades execute at its price.
- A probability based model estimates queue advancement from both trades and displayed depth decreases.
- Power and logarithmic functions provide alternative assumptions for allocating depth reductions ahead of or behind an order.
- Trade volume is subtracted from subsequent depth changes to limit double counting.
- Level 3 market-by-order data supports a separate queue model, while model accuracy is not empirically established here.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.