Skip to content
All library documents

Simulating Order Books with the Queue-Reactive Model

Article Quant Q&A · Author: naz

Summary

The document outlines a method for simulating order book events when limit order sizes matter. It recommends the queue-reactive model, which estimates the intensities of insertions, cancellations, and trades from the current book state. The model represents the book using queue sizes, with each queue measured in units based on the dataset’s average event size. For a given queue, the estimated event rates depend on its own size and the sizes of the neighboring queues.

A simulation repeatedly draws candidate events from these rates, applies the first event to occur, updates queue sizes, and continues. Event sizes can be modeled separately with a zero-intelligence approach. The note points to published research as support for the model’s state representation, but does not provide implementation details, calibration guidance, or validation results. Its brief description leaves choices such as event-size distributions and handling book boundaries to the implementer.

Key ideas

  • The queue-reactive model estimates order event rates from the current order book state.
  • Represent queue sizes in units derived from the dataset’s average event size.
  • Estimate each queue’s event rates using its size and the sizes of adjacent queues.
  • Simulate the earliest event, update the book, and repeat the process.
  • Event sizes can be modeled separately from event timing.

Tags

Full text
# Standard ways of simulating order books


# Standard ways of simulating order books












What are some standard simple ways of simulating an order book? I have found this paper, but it is missing the implementation details. And more importantly, it appears that it ignores the size of the limit orders when it "sweeps" the orders.

I am interested in backtesting a strategy where the size of the limit orders that I place into the order book - matter.

Any pointers would be highly appreciated.

## Answer by lehalle (score 5, accepted)

https://quant.stackexchange.com/a/77830

Nowadays (4 years after your question...), the best way to simulate orderbook dynamics is probably to implement the Queue Reactive model, 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.

It works the following way

- It will give you the intensity of the occurrences of events on the book: insert, cancel, trade, at any point in time

- The input will be the shape of the orderbook; it is enough (according to the findings of the paper) to keep track of the size of the considered queue, and the one just before plus the one just after (dimension 3).

That for

- summarise the shape of the orderbook by using the Average Event Size (AES) in your dataset; thanks to that you have the size $Q_k$ of any queue discretised in AES. Say $k$ is negative for the bid side and positive for the ask side.

- for each queue $k$, get the intensities $\lambda_{\rm cancel}, \lambda_{\rm insert}, \lambda_{\rm trade}$ of the 3 potential next events from the value of $(Q_{k-1},Q_k,Q_{k+1})$.

- Simulate points processes for these events.

- Implement the first one that occurs in your simulation.

- Update the queue sizes (you can us a zero intelligence model for the size of events),

- Loop

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.