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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
41 views

Reduce risk by adding a hedge when trading on two listings/order books (virtual exchange) [closed]

I am new to the world of financial derivatives and in my master's introductory course we are supposed to implement different trading strategies on a virtual exchange. The assumptions are as follows: -...
1 vote
0 answers
91 views

Combining two orderbooks

Consider two different pairs of currencies traded in the same exchange. We will call these pairs A/B and A/C. Each market comes ...
  • 163
1 vote
0 answers
24 views

Measuring latency with tcpdump and storing output

I am writing a code in python that streams real-time data from the Coinbase Exchange. ...
  • 163
0 votes
0 answers
70 views

Is it possible to increase websocket update speed?

I'm currently working with several crypto exchanges. I was sure that the maximum allowed orderbook update speed is 100ms as the Binance API documentation says. However, I've recently talked to ...
3 votes
1 answer
550 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 ...
  • 163
1 vote
1 answer
74 views

Order Book during trade halts

I noticed this weird structure of the order book during trade halt of $GCT, August 19th 2022. Stock was halted at the time. Could someone explain why bid is higher than ask? Is this just a bug in the ...
  • 113
1 vote
2 answers
130 views

Are there open source or academic-only limit order book data sets available?

I am looking for limit order book data for an academic paper that has a snapshot for every change in the orderbook (1st five levels are fine, but more is better) or can be built from ITCH files. Any ...
  • 113
1 vote
0 answers
134 views

How can a top-of-the book market maker protect itself from exploiting?

Let's consider there is an instrument N traded on a single venue (centralized anonymous limit orderbook). Let's say that most taker orders are tiny, therefore the one who stays at the best bid/offer ...
  • 33
0 votes
0 answers
41 views

Poor man's estimate of cancellations from LOB snapshots?

With detailed order and transaction records, it is easy to calculate the total value of cancelled orders for both bid and ask, for some time period, and also the average prices. However, if we only ...
0 votes
1 answer
122 views

Computing market impact from the order book?

Market impact as I understand it measure the difference in price between the first share that is bought and the last share that is bought when an buy order of N shares is submitted to the exchange. (...
4 votes
0 answers
70 views

Level 1 NBBO - what is going on?

Looking at some level 1 quotes data (QRM) on the bloomberg terminal for a DAX index option. Why is there always a 1 lot quote for 450 just popping in every other tick? Seems like there is a single MM ...
  • 93
1 vote
0 answers
43 views

Downloaded data is quote-driven or order-driven?

I downloaded data from Refinitiv Datastream (But I think that you get the same data from Bloomberg) to write my thesis. I downloaded prices and volumes. I have a crucial question now: Are the prices ...
  • 155
6 votes
3 answers
376 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 ...
  • 186
0 votes
0 answers
58 views

There is given a buy limit order. What is a probability that price will drop below this order?

Let's suppose that there is a buy limit order placed at time $t_0$ i.e. $(P,Q,t_0)$. Here $P$ stands for price of this order and $Q$ is the number of shares. Assuming that this order will be filled, ...
  • 279
0 votes
1 answer
48 views

Do IOC Orders Stay on the Order Book for Any Period of Time

I'm confused on whether or not an IOC (Immediate Or Cancel) order will stay on the order book for any period of time. For example, if I place an IOC buy limit order at \$1.00 and the ask price is $1....
1 vote
0 answers
54 views

Methods of predicting liquidity consumption

Let's consider limit order book for a certain stock. By liquidity consumers i mean traders that buy/sell shares using market orders. What are the known methods/models for predicting total amount of ...
  • 279
3 votes
0 answers
92 views

How to merge ML-based $\alpha$-signal with stochastic control approach?

I'm having a hypothetical situation where I have a set of ML-based alpha signals $\{\alpha_i\}_{i=1}^{N}$ that describe a different states of order book - imbalances, order flow, spread properties etc....
0 votes
1 answer
37 views

Difference between real and expected average transaction price of an order?

This might be a really simple question but I'm quite confused. I've been given a limit order book (I don't think it's necessary to upload it for my question but I can if you want me to) and I've been ...
0 votes
1 answer
88 views

Trading currency on Kraken.com platform using their REST API (AddOrder), is this correct?

I would like some confirmation on whether what I came up for buying/selling currency on kraken.com is valid. Right now I get ...
  • 101
1 vote
1 answer
466 views

Backtest: Fast Reconstruction of Order Book using Order Creation/Completion Data in Python

I am looking for a quick way to reconstruct the order book at the time of each new limit order creation. The data I have is order creation and completion: OrderID time_created time_completed price a ...
  • 11
2 votes
1 answer
436 views

Limit Order Book disaster recovery technique

I have designed a fast limit order book, similar to the one described here. It is working and passing the unit tests. Now, I am thinking of its reliability. i.e in case of failure (e.g unhandled ...
0 votes
0 answers
26 views

do prior day orders carry over to next day pre market order in Nasdaq?

I am looking at Stefan Jansen's machine learning for trading, specifically, rebuilding Nasdaq order book from Nasdaq itch data. In his jupyter-notebook, he says Throughout the day, new orders are ...
  • 101
0 votes
1 answer
109 views

How should Aggressive Limit Orders be Processed in a Limit Order Book

I am a little confused about how orders get processed in a limit order book, hope to get a better understanding with this post. If we start off with an order book ...
1 vote
0 answers
133 views

Market making algo using bid ask order volume ladder

I am looking for references for market-making strategies using bid-ask order ladder. Algo should suggest entry prices, and do inventory management. I am more interested in practical simple algo used ...
  • 499
5 votes
1 answer
432 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 ...
  • 183
2 votes
2 answers
276 views

How is forex market Quote-Driven?

I am new to the field, and trying to understand structure of spot currency market. As it is stated here, Quote-Driven Market ... only displays the bid and asks offers for a security from designated ...
1 vote
2 answers
533 views

Predicting price direction from order flow at high frequency

I have access to high frequency data for a few instruments using which I can simulate a limit order book.I would like to predict direction of price(best bid/ask) in the short term(1 sec, 5 sec and 10 ...
3 votes
1 answer
309 views

What does a electronic dealer track in a RFQ market?

If you have mid price for rfq market in fixed income. What is the internal order book tracking at a bank? Customers dont place limit orders or do they? There arent any other market makers on your ...
  • 2,262
7 votes
3 answers
3k 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?
  • 2,262
2 votes
2 answers
595 views

What are the proper ways to do order book downsampling?

I have an access to the order book dataset, which was sampled with resolution that is too high for my sandbox experiments with it. Because of that, I was wondering, what would be the correct way to ...
1 vote
0 answers
170 views

How to visualize limit order book in gui? What Library or widgets to use?

I have implemented a very simple limit order book in c++ . I would like to visualize it in a GUI application. I don't any experience in GUI. What library and widget may be used? Any suggestion in this ...
1 vote
0 answers
39 views

OrderId data type is double in tick by tick datafeed

I am going through multicast protocol for tick by tick data of national stock exchange(NSE, India) and the orders are uniquely identified by orderID and they have defined it to be a double datatype. ...
3 votes
1 answer
241 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 ...
1 vote
2 answers
171 views

Recreating Bid-Ask from Transactions data

A database only has transactions/trades for a given instrument. In order to recreate bid-ask of the instrument to estimate the average bid-ask spread, what process does one need to follow? what are ...
  • 61
1 vote
0 answers
26 views

How to find the equilibrium price in a CDA with limit orders?

I'm trying to understand how a continuous double auction works, by working through the below setup: I'm trying to figure out what the final results would look like how to determine the equilibrium ...
  • 111
1 vote
1 answer
106 views

How do limit order prices meet?

I understand how limit orders work but I don't know how do they meet. Suppose the book of a ticker ABC is empty. Trader 1 sends a buy limit order for 1 share of ABC at 2\$, and at the same time (...
1 vote
2 answers
377 views

Limit order book modeling based on computational statistics

Is someone aware of publications that try to model limit order book (and market mircostructure) in general using CS tools (such as online machine learning, game theory ecc...) and not stochastic ...
  • 11
3 votes
3 answers
204 views

Pegged Orders Positioning

I have a strategy that involves being first in the order queue in a tight market where the tick can change from bid to ask or ask to bid by one tick. I am looking at pegged orders so when the bid ...
  • 31
0 votes
1 answer
196 views

How Crypto Exchanges handle overlapping orders when self trading is disabled?

I am unsure how a typical "matching engine" handles overlapping orders (in my case, Deribit). I would be just as interested in how any crypto exchange handles the situation. The user has ...
2 votes
1 answer
140 views

How do locked markets get resolved in a low-volume market?

Consider a low-volume exchange-traded security that sometimes sees no trading volume for days on end. Examples of such securities are some bonds, preferred shares, SPACs, and ETFs listed on the NYSE ...
  • 501
0 votes
0 answers
86 views

Which features based on orderbook information could be relevant for price prediction?

I have some orderbook data, including 5 ask prices, 5 bid prices, amount of asks and bids for every price, and midprice which is equal to (best bid + best ask)/ 2. I would like to predict absolute ...
4 votes
1 answer
542 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. ...
3 votes
0 answers
409 views

Market Making Formulation

I'm developing a deep reinforcement learning based approach to market-making. In order to implement this, I need to define the appropriate actions and define environmental steps. While doing some ...
  • 61
1 vote
1 answer
553 views

Building Limit OrderBooks methods (order-based) or (level-based)

I'm trying to implement a code to build limit order books. While doing some research I have seen two methods mainly, order-based for equities and level-based for futures. I could not understand why ...
  • 321
0 votes
2 answers
118 views

How does a Stock Exchange Provider implement a Stop-Loss Order?

If I place a stop loss order at my provider. Is this order directly forwarded to the stock exchange? Or does my provider implement this logic. If so, do they have to declare any delays that arise by ...
  • 3
2 votes
2 answers
174 views

Order anticipation

Is there a way to anticipate order flow on a security. For simplicity's sake i'm referring to a security that is traded on one exchange and has a single order book, by anticipating order flow i mean ...
2 votes
0 answers
147 views

Competitive levels in Limit Order Books

I've been doing some research on electronic Limit Order Books (mainly equities) and I was wondering if anyone has seen a paper on how to compute competitive limit order prices. By competitive, I mean ...
1 vote
0 answers
39 views

Limit order book - Behaviour of GTC orders in the Orderbook

If I made a GTC (good till cancelled) to a Stock Exchange how will it stay within the Orderbook of the Stock Exchange if not executed during the day? Will it be removed after the trading day is over ...
1 vote
0 answers
55 views

What is the price when the buy limit is above sell limit [closed]

Consider a marketplace where the sell order book has one order for 10 units at 1\$, then 10 units at 1.1\$ and then 100 units at 2\$. Say that I want to buy 20 units, and that I place a limit order ...
4 votes
2 answers
4k 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, ...
  • 189