Questions tagged [limit-order-book]
The prioritized list of resting orders held by the exchange. Each limit order represents an obligation to buy or sell. The most common type of order book is prioritized first by price and them by time. Another variation is the price/size book, where larger size results in higher priority.
163
questions
78
votes
8
answers
68k
views
What is an efficient data structure to model order book?
What is an efficient data structure to model order book of prices and quantities to ensure:
constant look up
iteration in order of prices
retrieving best bid and ask in constant time
fast quantity ...
44
votes
9
answers
22k
views
What tools exist for order book analysis and visualization?
What tools exist for order book analysis and visualization? In particular, if one wanted to examine a limit order book and understand how it changes throughout the day where would you turn for ...
26
votes
3
answers
11k
views
How are limit orders selected from the order book?
I'm sure there is a simple answer to this but I haven't had any luck with searches. I'm just wondering when someone places a market order which order(s) from the limit order book are selected to fill ...
25
votes
5
answers
11k
views
Implementing data-structures in a Limit order book
I'm working on implementing a 'LOB' and I'm being very careful about choosing my data-structures so as to maximize performance.
Using F# as an example, I need to consider a List versus Array for ...
22
votes
3
answers
11k
views
Control for bid/ask bounce in high-frequency trade data?
The bid-ask bounce is the bouncing of trade prices between the bid and ask sides of the market. It introduces a systematic bias to the data which can cause serious problems in analysis.
What methods ...
20
votes
1
answer
2k
views
What techniques are used for testing order book implementations?
I am finishing the implementation of a limit order book for modeling NASDAQ. The order book works off of the ITCH feed. My question is what techniques are typically used for testing order books. I am ...
17
votes
3
answers
4k
views
Order submission strategies of a rational market maker?
Consider a market maker that has decided to try to make a round-trip trade in stock A in order to capture the bid-ask spread.
Assume furthermore that he has no current inventory in the stock A. To ...
15
votes
2
answers
3k
views
Order Book Dynamics
I have been following this paper:
Price dynamics in a Markovian limit order market, by Rama Cont and Adrien De Larrard
The model is especially pertinent as I only have access to L1 data.
The model ...
14
votes
3
answers
897
views
What is the most effective way of determining & measuring the level of HFT activity in a stock in (close to) real time?
On a security by security basis, I want to be able to quantify the level of HFT activity (and later institutional & retail activity). Is it higher than it normally is? How much so?
What would you ...
14
votes
1
answer
8k
views
How does one calibrate lambda in a Avellaneda-Stoikov market making problem?
In market making models derived originally from Avellaneda-Stoikov, there is a function lambda that represents the arrival rate of orders. In its prodigy, there are different representations of lambda,...
12
votes
3
answers
2k
views
Identify Iceberg Orders
What would be the best algorithm to identify Iceberg Orders?
I have found one in the paper "The Impact of Hidden Liquidity in Limit Order Books" by Stefan Frey and Patrik Sandas, but I was wondering ...
11
votes
3
answers
3k
views
Limit order book size
I am trying to write a highly optimised limit order book and I wondered what sort of size I can expect for:
Range of limit prices
Number of orders at each limit price
I am developing custom hardware ...
11
votes
1
answer
1k
views
A generic limit order book: What are the most important queries it should be able to answer?
Assume a class LimitOrderBook which represents a limit order book in a trading system.
To be able to represent the limit order book a data handler reads a feed ...
10
votes
1
answer
2k
views
How do I convert order book data into OHCL( Open,High,Low,close) format?
The image represents the order book data with columns having following attributes:
a0: Best ASK price (i.e. the lowest posted price at which someone is willing to sell an asset)
b0: Best BID price (...
9
votes
3
answers
7k
views
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?
Why are they algorithmically ideal?
9
votes
5
answers
5k
views
Estimate probability of limit order execution over a large time frame
I have a negligible amount of money (\$5000) that I would like to invest in a stock. I would like to buy the stock at some point in the next year, and get the lowest possible price.
I would like to ...
9
votes
1
answer
5k
views
how do we estimate position of our order in order book?
how would you estimate your order in the exchange order book? The order of order events and acks is not deterministic or guaranteed. How could you write an algo to estimate accurately your position in ...
9
votes
1
answer
1k
views
Why would a trader quickly flicker an order immediately preceding a tick away?
The Setup
Assume the inside market is $15.15 \times 15.16$ and there is a very large bid order imbalance. For example, 30,000 shares bid across 100+ orders, 200 shares offered across 1 order; however,...
9
votes
1
answer
591
views
Market Maker portfolio management
I am interested in articles/strategies related to portfolio and inventory management for market makers and to management of order cancellation, updates of order, etc.
Most of the strategies from ...
8
votes
6
answers
5k
views
FIX- what exactly do repeating groups represent?
I am trying to find out what is the purpose of "repeating groups" in FIX and what exactly do they represent? Are they all related to the same order and if so, why do you need repeated tags? If they ...
8
votes
4
answers
2k
views
Backtesting using microstructure (orderbook) data
I would like to use tick data (especially order book data; but also trade) to backtest my strategies, can anyone offer a recommendation? Personally, I've written my own backtesting scripts couple of ...
8
votes
2
answers
3k
views
Non-SQL methods for high-frequency accounting?
Does anyone know of any prior art for non-SQL data structures for high-frequency accounting, whether client, broker, or exchange-side? I'm thinking specifically of the problem of booking individual ...
8
votes
1
answer
1k
views
How do you calibrate a poisson arrival rate process?
Many papers in the microstructure literature assume an order arrival rate of the form
$\lambda^a(\delta) = \lambda^b(\delta) = Ae^{-k\delta}$
That is, an order that's placed $\delta$ away from the ...
7
votes
1
answer
7k
views
open-source implementation of orderbook from FAST?
I'm looking for c/c++ implementation of OrderBook. I need implementation to reconstruct market data from FAST. I don't need to do "matching" because it already did by exchange, I only need to "...
7
votes
2
answers
3k
views
Order Execution Algorithms
To execute large orders under minimum price impact or to hide a market view, trading systems sometimes utilize special order execution algorithms or order types.
One example is an iceberg order, ...
7
votes
1
answer
4k
views
What exactly is an ISO order?
I have been looking this up and I feel like I keep running into different definitions. My understanding is that an ISO order is one which will get filled with the displayed quantity in a particular ...
6
votes
2
answers
1k
views
How can one effectively approximate the fill portion of a limit order in a FIFO order book given it's recent state?
What methods could one use to find the step wise probability of a partial or full fill of an order in the best ask/bid level of a limit order book given the historic best ask and best bid quantities ...
6
votes
3
answers
899
views
What is the correct / expected behavior for a market order sent to an empty book?
Should it stick around until liquidity shows up? (GTC)
Should it cancel any size for which there is no liquidity? (IOC)
Is there such a thing as Market GTC or Market Orders must always be IOC?
6
votes
2
answers
8k
views
How to understand micro-price (aka, weighted mid-price)?
The definition of micro-price is
S = Pa * Vb / (Va + Vb) + Pb * Va / (Va + Vb)
where Pa is the ask price, ...
6
votes
1
answer
721
views
Limit and Market Order for training a ML model
Goal : Using deep learning to build a ML model which would predict the right places where a stock price will increase, decrease or stay stable.
For the current question, assume the labels are well ...
5
votes
4
answers
1k
views
Deep bid ask orders
Why do I often see some very deep limit buys and limit sells in a limit book? For instance the bid-ask may be \$39.00-39.01 but I see some bids at \$20 or even \$10 and some ask at \$60 or even \$500. ...
5
votes
2
answers
531
views
Limit order book - does it get wiped over night?
Let's say we have a look at the NASDAQ's limit order book. We do have a bid side and ask side levels.
Does the limit order book get wiped over night? Meaning everything which is not executed is ...
5
votes
1
answer
968
views
Modelling queue position
Is there any viable way for me to know the dynamics of my LOB position? Lets suppose the LOB is order based LOB, and i send a order to this level, can i know if the qty in front of me cancelled vs ...
5
votes
1
answer
613
views
Limit order book cancellations
Is there any practical and academic interest in predicting which orders in a limit order book will be canceled?
From a policy point of view are people interested in detecting potential spoofing ...
5
votes
2
answers
1k
views
Complexity of using balanced-tree to model order book
I have bene researching on the best data structure to implement a limit order book. Some of the most common implementations include arrays and balanced trees. This link has a good set of references.
...
5
votes
2
answers
603
views
What does ABBO (Away best bid and offer) refer to?
I know what the NBBO is but I've seen mention of ABBO and I'm not sure what it means?
5
votes
2
answers
653
views
What are "Autoquotes"?
I'm reading a 2008 JoFMarkets paper by Shkilko et al. with title "Locked and crossed markets on NASDAQ and the NYSE" in which the authors investigate the determinants of locked and crossed markets. ...
5
votes
1
answer
655
views
What is the proportion of aggressive orders vs passive orders executed by different types of traders?
It's clear that each aggressive order (or market order or limit crossing BBO) is matched against the same volume of resting limit order(s).
I'm interested in statistics per different types of ...
4
votes
1
answer
2k
views
Efficient way to store orderbook in Python
I am using the Coinbase WebSocket API to extract real-time data about the orderbook for BTC-USD.
I am using the following code to store the snapshots of bids and asks and the changes to the orderbook ...
4
votes
2
answers
3k
views
What are flickering orders?
I am reading a paper for my bachelor thesis, Queuing Uncertainty in Limit Order Market by Bart Zhou Yueshen who is the new AP at INSEAD.
In the abstract, the author said: "Flickering orders manifest ...
4
votes
3
answers
837
views
Latency and Delays across Exchanges
I have recently come across this paper by Battalio et al. "Can Brokers Have it all? On the Relation between Make Take Fees & Limit Order Execution Quality" and realized how little I know about the ...
4
votes
1
answer
1k
views
Model reference price of Limit order book
first of all, the description of this Stackexchange forum says its for professionals or academics. I'm doing a lot of self studying and with that I was able to understand some white papers but still I'...
4
votes
1
answer
460
views
What is a good source to learn the different nuances of electronic orders and their nature?
Today I was speaking with someone involved in high frequency trading. They were mentioning hidden orders, queue positions (which can be lost in the orderbook based on certain order modifications), ...
4
votes
3
answers
450
views
Order Replacement Trade-off for a Market Maker
Whenever we replace an order, we lost priority since we are added to the end of the queue. If we dont replace an order, there is an obvious chance that we might get picked. There are other situations ...
4
votes
2
answers
6k
views
Calculating true value of a stock given the order-book and recent trades
I'm trying to calculate the 'true value' of a stock listed on an exchange. I have access to the limit order-book (containing all bid/ask quotes) and also all trades which have taken place (which ...
4
votes
4
answers
722
views
Modelling HFT data
In the context of Market making, how important is recent trades? In general, would i be able to get away with just modelling the Limit Order Book (LOB) and the evolution of the LOB in order to ...
4
votes
3
answers
715
views
Executions deep in the Limit Order Book?
I have some Level III (message level) data for equities and I have found several cases in which I register the execution of a Limit Order at a price "worse" than the best bid or ask.
For example, ...
4
votes
1
answer
222
views
Modeling orderbook shapes as distribution
What are different distribution models typically used for generating orderbooks under high volatility, illiquidity, and multiple exchanges with different fees?
4
votes
1
answer
603
views
Mid-Point calculation with execution probability
Referring
Cao, Hansch, and Wang (2004) "The Informational Content of an Open Limit Order Book"
$$
\mbox{WP}^{n_1 - n_2} = \frac{\sum_{j=n_1}^{n_2} (Q_j^d P_j^d + Q_j^s P_j^s)}{(Q_j^d + Q_j^s)}
$$
...
4
votes
1
answer
223
views
Avellaneda High-frequency trading in a limit order book
From the paper, High-frequency trading in a limit order book, (Avellaneda, 2006), from equations (16) and (17), the reservation price is given by
$$
\begin{aligned}
\theta_t + \dfrac{1}{2} \sigma^2 \...