11 votes

How do I convert order book data into OHCL( Open,High,Low,close) format?

As Alex C. notes, OHLC bars are meant to be calculated using transaction ticks. However, you could try to make bars from bid/ask individually (or perhaps even the mean of the two as an approximation), ...
lagrange103's user avatar
5 votes

Limit Order Book disaster recovery technique

For data on a given single host, a common architecture is to write the data onto a queue (could be multi-consumer or single consumer), and have an asynchronous writer that reads it off and persists it ...
databento's user avatar
  • 2,488
4 votes

Would it be fair an exchange where priority in the order book is the fee paid per share in the order?

I think this would be equivalent to having an infinitesimal tick size, since you could always improve your execution priority by increasing the price you offer.
wildbunny's user avatar
  • 629
3 votes

Interpreting an Order Book (example Kraken.com)

This question is unclear to me, what is your goal? It's in BTC Both BTC You can increase your BTC position and decrease your USD position by buying the pair and decrease your BTC position and increase ...
Bob Jansen's user avatar
  • 8,552
3 votes

Order Replacement Trade-off for a Market Maker

they are now plenty of academic resources to address the point of interacting with liquidity via limit orders: Stochastic control is the best way (it's optimal!) but you need a model of liquidity ...
lehalle's user avatar
  • 12.1k
3 votes
Accepted

Exchange order matching system/core for local testing

I am not aware of any such service but simulating exchange behavior for backtest is very challenging given irregular order arrival and their impact and hidden orders. Even the paper trading service’s ...
quantinho's user avatar
  • 474
3 votes

Estimating the spread of a market maker

Model Building I will answer this question from a statistical perspective since that has a definitive answer (under stated assumptions) assumption 1) Suppose that each market-maker applies the same, ...
Attack68's user avatar
  • 10.2k
3 votes

Would it be fair an exchange where priority in the order book is the fee paid per share in the order?

Would it be fair? On the one hand, the total price paid for a security is simply the asset price + execution fee, and if one is willing to pay higher than another party then so be it, that's their ...
Attack68's user avatar
  • 10.2k
2 votes
Accepted

Orderbook db structure

Have you considered storing it by adding the additional fields ('level' or 'depth') and ('type'), then you can have a table which looks like this; ...
Attack68's user avatar
  • 10.2k
2 votes

Market makers order execution on the order book

Owen, designated market makers in general are required to send in a two sided market (a bid and and offer) within a certain width for a certain percentage of the time. There's no obligation to cross ...
JoshK's user avatar
  • 2,613
2 votes

Would it be fair an exchange where priority in the order book is the fee paid per share in the order?

Yes, that's fine, though I think, it's better to think in terms of minimal price increments: essentially, you're suggesting to replace 1 cent minimal increment with something much smaller. So, say, an ...
LazyCat's user avatar
  • 1,551
2 votes

Question about order book and single player interference

This is a complex question. First of all, you need to know that orderbook manipulation is illegal. That being said, I can rephrase you question as: given an orderbook say a new sell order of size $...
lehalle's user avatar
  • 12.1k
2 votes
Accepted

What approaches are there for keeping local and remote order books in sync?

My 3 points for you: Earlier checks like pre-compliance checks for orders are usually performed. Three different types of orders are correctly recognized - i.e. proposed orders but not routed, ...
Rads's user avatar
  • 80
2 votes
Accepted

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

It depends: Does the exchange support Stop orders? Some do, some don't. You can find it in exchange's documentation. If the answer is "no" but your broker offers it, then Stop orders are managed ...
Serg's user avatar
  • 1,022
2 votes

Order anticipation

If by order flow you mean high-frequency changes in prices, returns, volume, and other variables based on intraday data at various levels of market depth, yes there are various approaches that have ...
develarist's user avatar
  • 3,000
2 votes

Difference between IOC and FOK orders

Generally FOK means Fill Entirely or Cancel. IOC means "Fill what you can and then cxl the remainder"
JoshK's user avatar
  • 2,613
2 votes

Orderbook Liquidity Parameter Avellaneda Stoikov

in our extension of Avellaneda - Stoikov paper, we provide some numerical examples: Dealing with the Inventory Risk. A solution to the market making problem. In Faisabilité de l’apprentissage des ...
lehalle's user avatar
  • 12.1k
2 votes

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

A limit buy means he is willing to pay up to \$200 for 1 unit. Since there is one offer of 1 unit at \$100 that one will be bought out first followed by 1 unit at \$200. So only a total of \$300 of ...
stackoverblown's user avatar
1 vote

Stock trading data across multiple vendors interview question

I wasn't there so I can only guess but I think the below is reasonable: Exchanges is where trades trade and in this context data vendors are often third parties that deliver historical data on all ...
Bob Jansen's user avatar
  • 8,552
1 vote

How do we relate time-horizon with reducing inventory risk in the Avellaneda-Stoikov model?

Be aware that the Avellaneda-Stoikov model is a Taylor extension of the full model when $q$ is small. We developed (following their seminal paper) the full model in Guéant, Olivier, L, and Joaquin ...
lehalle's user avatar
  • 12.1k
1 vote

Orderbook Liquidity Parameter Avellaneda Stoikov

On top of the very good paper by Sophie Laruelle that Mr Lehalle suggested, I would also suggest to have a look at the Modeling, optimization and estimation for the on-line control of trading ...
LaGabriella's user avatar
1 vote

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

In my opinion the best way to do it is to rebuild the orderbook from order flow. But first of all it seems very strange that you start with this data frame, usually you do not know the deletion date ...
lehalle's user avatar
  • 12.1k
1 vote
Accepted

Stock market simulator coding problem

The price is given per unit, the quantity gives you the available size or depth. The actors of the market will give you the lowest at which they are ready to sell and highest at which they are willing ...
Mayeul sgc's user avatar
1 vote

Pegged Orders Positioning

Pegged NBBO/MidPoint orders, each exchange has algo check documentation or contact them about time/price/Fifo and most importantly pro-rata allocations for peggged orders. Here is a doc from NYSE to ...
JBerstein's user avatar
  • 101
1 vote

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

It is important to note the difference between "regular" buy / sell orders and "stop-loss" orders in terms of how they enter the order book. Regular buy/sell orders enter the order book immediately ...
Jan Stuller's user avatar
  • 6,098
1 vote

how to calculate/retrieve the number of sell orders (and buys orders as well) to detect iceberg orders

A short answer is to use reliable market data and a trading platform which doesn't wrap precious details in the market data into candles. Your algorithm is a reasonable, but is an approximation. A ...
Serg's user avatar
  • 1,022
1 vote

How to identify buy walls and sell walls from a limit orderbook?

I suggest to get inspiration from Huang, Weibing, C-A L, and Mathieu Rosenbaum. "Simulating and analyzing order book data: The queue-reactive model" Journal of the American Statistical ...
lehalle's user avatar
  • 12.1k

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