Simulating HFT

Discussion in 'Automated Trading' started by bbt80, Jan 1, 2021.

  1. bbt80

    bbt80

    Hello,

    I'm studying HFT strategies, market makers algorithms and trading algorithms for specific goals (like minimization of overall transaction costs).

    So I'm creating a database of Level II quotes (initially from a single instrument) and need a way to run simulations of the order book, send my own orders (adjusting in "real time" their impact by some predefined rule) etc.

    There are some implementations of order matching engines on github. There are even tutorials on Youtube. But it'll be necessary to customize those in order to fulfill my needs and I do not want to commit to a solution before consulting those who understand the subject. On the other hand, maybe there's a ready (probably paid) software for this.

    If it is open source, I prefer a C++ codebase.

    Anybody know?



    PS.: Just to be clear, it's just for research:

    I don't intend to trade this way!
     
  2. MarkBrown

    MarkBrown

    you are trying to figure out he method of hft algo or esreveR engineer how else can you know the impact?
     
    tradeking007yahoo likes this.
  3. bbt80

    bbt80

    My initial concern is with exploratory data analysis and simple simulations. In this way, the impact would be zero at first. Later on I would adopt a zero-intelligence model. Just an example: after the aggressive order (of small size), the book could be randomly recompleted following some predefined distribution and everything else would be adjusted accordingly (locally) in order to minimize the impact of this small "perturbation". As simple as possible for a small research.
     
  4. traider

    traider

    just connect to bitmex. their data feed is real and free and u can quote small amounts
     
  5. MrMuppet

    MrMuppet

    there is no need to simulate impact minimizing algos such as TWAP, VWAP or similar slicers. It's well known how they work and you cannot really do much more than divide your big order into smaller ones.

    With HFT market making algos it's different, however, you would need much more than just a single stock to simulate their impact. Markets are made out of an entire portfolio. ETF arb, dispersion, basis trading, etc.

    So you would need the data for an entire asset universe to track impact and strategy. It also depends on the markets you're looking at. Petro is different than grains for example and futures are generally different than stocks since...well one exchange vs. 16 + dark pools and a different rule set.

    I would suggest you zone in on identifying predatory algos that focus on exploiting inefficient orderbooks. Your life will be a lot easier if you look at illiquid assets vs. major ones such as indices or blue chips.

    P.S.: Nobody will ever share a profitable algo with you that is in production. Never. People sign tons of paperwork before they work on stuff like this at a firm so these don't get leaked.

    You're basically asking for the equivalent of the coca cola recipe.
     
    MarkBrown and bbt80 like this.
  6. bbt80

    bbt80

    Thanks! As I'm not an expert programmer, I'd like to save some time starting with an engine (just an efficient order matching algorithm). There're a lot of them on github and the idea is simple. I just want to get the best I can for free. So, no trading strategies involved.

    With respect to the impact simulation, my approach is empirical: I have all the order flow and the book responses to it. I just need to find a probabilistic rule (for example). As I said, it's just for research. No bank account will be harmed :).
     
  7. They

    They

    The fact is that most HFT strategies are not aggressors - probing the bid/offer aggressively to monitor an impact. They are the passively monitoring each price change and the effect it has on the orderbook and then positioning accordingly. Everyone is trying to locate the icebergs.

    It sounds like you are trying to simulate the impact of your small boat/aggressive orders hitting an iceberg of unknown size.

    #Titanic

    What is he doing.gif
     
  8. bbt80

    bbt80

    I got your point. But simulating my own orders is not important at this point (let alone estimate their impact). From a practical point of view maybe it's useless too, although I'm not a trader.

    I have a database with all the market activity for a single instrument, including the brokers id. The information is already there (probing, spoofing etc). I just need to crunch those numbers/events fast and in every manner possible.
     
    They likes this.