53 votes

What is an efficient data structure to model order book?

The specifics depend on if you're implementing for equities (order-based) or futures (level-based). I recommend https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-...
Charles Cooper's user avatar
24 votes
Accepted

Red Black Trees for Limit Order Book

Why do people suggest using red black trees/balanced binary trees for the levels in a limit order book? Because people are unoriginal and keep referencing the same blog post. Why are they ...
databento's user avatar
  • 2,368
19 votes
Accepted

Backtesting Market Making Strategy or Microstructure Strategy

This is a very difficult question. 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 "...
lehalle's user avatar
  • 11.5k
18 votes
Accepted

What are modern algorithms for trade classification?

There are a few approaches to use trade prices and quotes to classify the aggressor as "buy" or "sell." Also, many of these methods have historically had to deal with ...
kurtosis's user avatar
  • 2,880
17 votes

Market impact, why square root?

I found this power point and this paper to be an excellent source on this topic. Here is a quote from the paper: A square-root singularity for small traded volumes is highly non-trivial, and ...
JoseOrtiz3's user avatar
12 votes

What is an efficient data structure to model order book?

I recently stumbled upon this question after needing to do this to do some real-time microstructure analysis and have taken a look at the various possible implementations. Here are some of the pros/...
alfalfasprout's user avatar
11 votes
Accepted

How do better informed traders apply their advantage over the others?

Example from recent memory. Right before New York open, Bloomberg posts an article saying country R's local news reported that R's government auditor said that country V has defaulted to R's loans to ...
Dimitri Vulis's user avatar
10 votes
Accepted

What are some currently open problems in market microstructure

They are a lot of open problems in market microstructure. To have an idea of the whole landscape, have a look at Market Microstructure in Practice, 2nd Edition, by L and Laruelle. I would split them ...
lehalle's user avatar
  • 11.5k
10 votes
Accepted

Using market microstructure and exchange-specific knowledge to design trading strategies

I'll give examples of each: market microstructure, exchange protocols and connectivity. Private fills Probably the most well-known in the public domain is the idea of a "canary order". In ...
databento's user avatar
  • 2,368
8 votes
Accepted

Order Book Dynamics

The Queue Reactive Model (by Huang, L and Rosenbaum) is an improvement of what Cont and de Larrard (CL) did. This model is capturing the inflows and outflows in each queue given the current state of ...
lehalle's user avatar
  • 11.5k
8 votes
Accepted

How does one calibrate lambda in a Avellaneda-Stoikov market making problem?

(First of all, sorry to have taken so much time to see this question...) For the paper you refer to (Guéant-L-Tapia), there is a report (in French) by Sophie Laruelle about how to do it in practice: ...
lehalle's user avatar
  • 11.5k
8 votes

How to identify market makers in an orderbook?

You could also look at how each price level is made up. For example how is the 18 lot on the bid price 0.0995 collated. Is it a 5 lots, 5 lots, 7 lots and 1 lot. You can do this on certain exchanges ...
youtta's user avatar
  • 81
8 votes
Accepted

Backtesting using microstructure (orderbook) data

Since order book granularity backtesting is challenging, as you've pointed out, I recommend first deciding your business requirements: Can you rely on a third party execution desk? I do not recommend ...
databento's user avatar
  • 2,368
7 votes
Accepted

How can we estimate new stock price after a large purchase?

There are a number of price impact models which seek to predict the bias induced on prices by trading. There are also issues with some of these models (which I will mention later). Models Probably the ...
kurtosis's user avatar
  • 2,880
7 votes
Accepted

What are the proper ways to do order book downsampling?

Two chief reasons for subsampling or using a different event space are (i) computational or spatial tractability and (ii) denoising/signal extraction. Sergei's response seems to focus on the first ...
databento's user avatar
  • 2,368
7 votes

Stochastic equation in "High Frequency Trading in LoB, Sasha Stoikov and Marco Avellaneda"

First part of your question: The solution comes from solving the SDE specified in the paper and then using the moment generating function of a normal random variable. Formally, let us define the SDE ...
Pleb's user avatar
  • 4,176
6 votes

Order book size limit

I am not aware on any rules preventing a too high number of entries at a limit price. Nevertheless you usually have controls for each trader id. A trader cannot have too many orders in the book or ...
lehalle's user avatar
  • 11.5k
6 votes

What is an efficient data structure to model order book?

Curious how nobody in 9 years has provided an optimal answer yet? You need a B-Tree that has been extended with a double-linked list on each node. The B-Tree to find (or not find if they're missing) ...
Anon Coward's user avatar
6 votes
Accepted

What are flickering orders?

A "flickering" order is one which is repeatedly submitted and cancelled (whether it's at the top of book or not). The answer from @chollida mentions that "the goal typically is to either slow down ...
Chris Taylor's user avatar
  • 5,891
6 votes
Accepted

Reference request: Quantitative approaches to market abuse detection

I can't help as much with public literature, but I did see a talk with a member of the FINRA data science team responsible for exactly this (event link below - perhaps you can track down the speaker). ...
mperlow's user avatar
  • 446
6 votes

Market impact, why square root?

My understanding (devoid of any mathematical grounding) is as follows. v = Turnover PER UNIT TIME n = Shares you need to execute therefore ...
hjw's user avatar
  • 339
6 votes

How can we estimate new stock price after a large purchase?

Let me try to answer: I have seen how equity trades are executed at the order book level. Let's say the price of the stock is 100 (last traded price). Let's say the order book is as follows: Bids: ...
Jan Stuller's user avatar
  • 5,998
6 votes
Accepted

What does a electronic dealer track in a RFQ market?

Customers dont place limit orders or do they? No, they don't. In an electronic RFQ market, the requesting participant (presumably the "customer" you are referring to) is generally not ...
databento's user avatar
  • 2,368
6 votes

Do MarketOnClose orders cross a bid-ask spread?

A simpler way to debunk these studies without having actual trade and quote data at the exchange level is to just take into account transaction costs, IBKR's half a penny per share is a good starting ...
pyCthon's user avatar
  • 2,081
5 votes

What is an efficient data structure to model order book?

Why not just implement it with two price-amount maps, as shown here?
Dmitri Nesteruk's user avatar
5 votes

What is Toxic FX Flow debate?

The primary way ECNs determine if a liquidity taker's flow is 'toxic' or not is by looking at aftermath charts. The aftermath chart shows the average mark-to-market profit of trades done by the ...
mpeac's user avatar
  • 415
5 votes
Accepted

HFT market-making in dark pools?

Yes, it is. There is plenty of information about it online. E.g. here's a related very recent article: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2874957, here's a link to a discussion on ...
LazyCat's user avatar
  • 1,541
5 votes
Accepted

Economics of spoofing

Layering is a spoofing of buy(sell) orders sometimes complemented by higher(lower) sell(buy) orders that push the market up(down). Execution of a limit order above(below) would not be a concern, as ...
rrg's user avatar
  • 949
5 votes
Accepted

What makes open-outcry preferable to electronic trading and what are its consequences?

The better price will come from two live traders (one on each side of the trade) willing to take a smaller percentage commission for a large block trade. For example, if a trader's average commission ...
amdopt's user avatar
  • 4,738
5 votes

Identify Iceberg Orders

Liquidity seeking is difficult to test empirically since price only data tells us nothing about the how transactions related to the level 1 (NBBO) order book, let alone the depth of the order book. ...
David Addison's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible