How does one backtest either a market making strategy or microstructure-based strategy? I'd imagine that one way would be to record order book states over time and then insert the orders, but it seems like this is problematic since it neglects the reactions other traders may have to a new order.

Also, if we intuitively knew that a strategy would be predated, there would be little incentive to pursue backtesting it anyway. So the question then becomes, how do you backtest the actions of other unknown traders?


3 Answers 3


This is a very difficult question.

  1. First of all you should read Almgren's slides on the topic: Using a Simulator to Develop Execution Algorithms. First you need to backtest your strategy against a "replayer". Ok it is not perfect, but it gives you information anyway. Provided you add some "sanity limitation" to this simulator (i.e. do not allow you strategy to remove the same liquidity two times, or to react too fast to market events), you will obtain something not too bad.

  2. Then you can follow the methodology proposed in High-Frequency Simulations of an Order Book: a Two-scale Approach by L-Guéant-Razafinimanana. It addresses exactly the case you have in mind. The proposed solution is: model the arrival rate of orderbook events given the state of the orderbook and the future price (yes you have access to the future price in historical data).

  3. If you want to remove any use of this "future", you can use simply use arrival rates of orderbook events given the current state of the orderbook following Simulating and Analyzing Order Book Data: The Queue-Reactive Model by Huang, L, and Rosenbaum.

In short: if you use (1) you may not take into account enough others' reaction; if you use (3) you may obtain simulations that will ove the price too much (especially if your strategy is highly liquidity consuming), and with (2) you will be in-between.


IMO you can't backtest a HFT strategy because you cannot account for your own queue depth, or the API lag of the exchange, and more importantly, you cannot really model informed traders very well, who will pick off your badly placed limit orders.

For a broad range of HFT strategies, good queue depth is everything(1), and this isn't something you can just guess, you have to measure it in practice. This essentially just means forward testing and a lot of screen watching in my experience.

(1) http://market-microstructure.institutlouisbachelier.org/uploads/91_7%20MOALLEMI%202014-12-paris-mm-queue-value.pdf

  • $\begingroup$ If you're going to down-vote, at least have the decency to state your reasons. $\endgroup$
    – wildbunny
    Commented Jan 17, 2019 at 13:08

Just a brief remark - here's a paper you might find interesting. The authors compare "market replay" trading strategies (roughly the same as backtesting) with more sophisticated "interactive agent-based simulations".


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.