Disclaimer: Brand new to high frequency algo trading.

Background:I have tick-by-tick trade data for stock A and I have joined the price and volume data for each trade with the previous snapshot of the first level of the Quotes book table (i.e. BID and ASK snapshots). I thought this would be useful since you can see where the trade was lifted from (i.e. did it hit the bid or lift the offer?).

enter image description here

Question: Now I would like to simulate a trade execution (while assuming no market impact). In particular, assume I sit at 11:00:55 and my algorithm wants to place a buy order for 20 shares. How exactly would the execution algorithm play out? What's a simple conservative approach? In the case I'm considering, it's ok to wait a bit to execute the trade.

What I'm thinking: Look at the last trade as a reference price and put that price down on the BID side for 20 shares. Now passively wait to see if my BID was crossed for a few ticks, if not, increase the price a bit. Looking for some ideas from an expert or non-nube! Thank you.

  • $\begingroup$ Are you asking how to write an exchange simulator to back-test a strategy, or are you asking about the strategy itself? $\endgroup$
    – wildbunny
    Commented Jan 23, 2019 at 8:26
  • $\begingroup$ @wildbunny exchange simulator $\endgroup$
    – John Doe
    Commented Jan 23, 2019 at 13:27

1 Answer 1


It depends how accurate you need the simulator to be, on the one hand you could simply use the change in bid/ask to gauge whether your simulated order was hit, and on the other you could be modelling things like the the order matching process based on a model for order and trade arrival rates/process.

The simple method is probably not suitable for modelling high frequency trading however as it completely ignores microstructure, queue depth and the presence of informed traders.


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.