Tag Info

Hot answers tagged

17

This is determined through order precedence rules. In most markets, these are Price priority: precedence goes to the best ask or bid offers. Time precedence: precedence goes to who improves the current ask or bid offers. In computer-speak that's FIFO. It encourages the market participants to improve prices aggressively. Public order precedence: public ...


11

All exchanges allocate to best price. This is by law in the US, and it's unimaginable that an exchange would do otherwise in other jurisdictions. As for tie-breaks, there are two possibilities for public orders: Time: first-come first-served; used for most equities exchanges Pro-rata: larger quote sizes get more of an incoming market order; common for ...


10

Since Quant Cup 1's objective was an efficient price/time matching engine, the data structure of the winning implementation might partly be what you are looking for. Else the setup of LOBSTER is supposed to be quick.


10

As RYogi indicated, this depends on the exchange and product type. e.g. here is a summary of the matching algorithms at the CME The answer to the second part of your question is yes. Even in a market like the Eurodollar futures -- which is mostly pro-rata, but has a FIFO component -- a common strategy is to "stack the book." So that you will be first in ...


10

IMO transaction data is a better approach, because you have both sides of the trade agreeing that the price is "right." The literature tends to decompose the transaction price $P$ into a true/efficient price $P^e$ plus micro-structure noise, which I think originates from Hasbrouck '93 in the Review of Financial Studies. So you end up with something like ...


9

I don't know why it was removed, but the R package "orderbook" was available: http://journal.r-project.org/archive/2011-1/RJournal_2011-1_Kane~et~al.pdf http://cran.r-project.org/web/packages/orderbook/index.html In the IBrokers package, the function "reqMktDepth" is used for streaming order book data. ...


8

You don't say what it is that you do with trade data that is made difficult by the bid-ask bounce. If it's for the purpose of establishing the price at which you can trade and it's at a frequency where the bid-ask bounce is a problem, then I think having realistic execution assumptions is the way to go. In particular this means that you should be mainly ...


8

Market makers place quotes on both sides (ie, the bid and the ask). Depending on the market, the MM might even be contractually obligated to provide liquidity within some threshold. NYSE's designated market makers (who replaced the specialists a few years back) are an example. Even when there is no explicit requirement, the MM will quote both sides and ...


7

The flickered orders are postonly bid at 15.16. The exchange slides it back to 15.15 to avoid a locked market. Submitting firm sees the slideback and cancels. Then tries again. When the 15.16 offer is executed or cancelled out, the offer moves to 15.17 then the postonly bid at 15.16 goes through at the targeted price and gains good queue position.


7

So one such visualization package is demonstrated in http://www.tradeworx.com/movie/booklet_demo/temp/booklet_demo2.mov. AFAICT it looks like a tk script. Trading Technologies (TT) sells another visualization tool. But TBH writing your own tool takes a few hours and allows you to focus on what information you are interested in finding.


6

Validating tops against the consolidated is a good method. Obviously the time stamps won't match up, but the event stream should. Bear in mind that this won't tell you much about whether you're getting the inner dynamics of the book correct (for example, did the newly inserted order go into the right spot within a given price level). You should build ...


6

If you're writing a "highly-optimized" book then you should be tailoring that book to the venues from which you will be receiving data. Max price, for example, is published in NASDAQ's Itch spec: 200,000.0000. If you plan on trading US equities you better go read each of the venues depth of book specs very carefully. You'll find all sorts of ways to ...


6

i am not a F# expert but when it comes to performance and thread safety try sorted list or hashset. sorted list if the data needs to be sorted (it gets sorted when added to the list) otherwise hashset, no sorting hence better performance. they are both generic. in addition i would think you need thread safety when reading/writing/updating your data in ...


6

You won't know who made the trade, so you'll need to look at the quotes. Specifically, you should look to see if there are a lot of cancellations in the full order book. That will tell you if there's higher "churn" for a particular stock since HTFs often have low fill ratios (<1% for some shops). But you'll need to control for volatility since wild market ...


6

There is no need to complicate things: ... d = getBdepth(); d = getOdepth(); // for the calls below pos == 0 means the best bid/offer p = getB(int pos); // bid price at pos p = getO(int pos); // offer price at pos q = getBq(int pos); // bid quantity at pos q = getOq(int pos);// offer quantity at pos Note that the above API is not the best choice if your ...


6

You don't just simply grab some random open source order book implementation and expect it to work. Every market is different. For example, markets have different rules for how you should handle priority in the order book (some are price-time, some are price-size-time, etc). Grabbing Joe Blow's code and expecting it to just work is only going to lead to pain ...


5

You have two ways to estimate your position in an order book: first if you have access to an ITCH feed, you can recognize your order into the ITCH updates, and know exactly where you are, but you will have to build an engine to translate an order-by-order ITCH feed to a limit order book; or you have to use estimates; the easiest way to build one is to ...


5

Each venue will allow diferent order types, and will have different matching rules (the queue positions you mentioned), so this is not general to the whole market, but this is a paper from Nyse that is pretty much explains most of the order types I have heard of: http://www.nyse.com/pdfs/fact_sheet_nyse_orders.pdf Also, one factsheet/regulation from the ...


5

I can think of 3 reasons: 1) Queue position 2) To be on the other side when an alogrithm has a disastrous error, which happens quite often on singular stocks and doesn't get reported (but someone will get fined) . I've seen cases where the price will drop over 99% almost instantaneously. For this to occur a backfiring algo will clear out the entire bid ...


4

Assuming that: limit prices of Long and Short orders are equally pre-calculated in all 3 strategies; there is no risk-free return; strategies 1 and 2 have equal quality, and strategy 3 is slightly better. However, the only advantage that strategy 3 takes over 1,and 2, is better location of the orders in the price level queue. In case of FIFO (price-time ...


4

You might find the paper "Low-Latency Trading" by Hasbrouck and Saar useful. In it they discuss the episodic nature of some high-frequency flow and construct some useful measures of this flow. Generally, I would think some model that relates the cancel rate with the quote rate is most useful.


4

A correct answer would depend on the instruments and markets you're trading, and whether this is for handling public or propietary orders. For example, if I were to design for the simple case, US equities and a public market, I'd want the queue size at each price level to be able to handle at least the maximum daily volume of, say, QQQ. I know that's in no ...


4

Repeating groups are a way for FIX to represent arrays. A "number of" field prepends the repeating group to alert the recipient how many elements to expect. For example, Arca uses TradingSessionID (tag 336) to identify pre-open (P1), primary (P2), and post-close (P3) market hours. This group is prepended by NoTradingSessions (tag 386). So, I would use the ...


3

Your first definition is wrong; I'm not sure where you got that from. Your second definition is correct: the ISO alerts the exchange that the submitting party has taken responsibility for RegNMS and requests a fill at only that venue's price; there is no routing away. Obviously, there is a huge red-tape burden to get permission to do this.


3

I have to think that there are a lot of very fast, very optimized special-purpose accounting engines out there filling this role. Yes and no. I do not think you are high volume at all - you just have a corporate-level server for the database, not a cheap low-end hosting. I do about 2000 transactions per second on a SQL Server with a mid-range ...


3

F# provides you with many data structures for collections, but in functional programming, you try to have immutable data structures, such as the F# List. It becomes quite handy if you want to do some parallel computing, for example. You can have a look at my post on SO which is probably where you could ask your question in a more generic way such as "What ...


3

An un-marketable limit order (buy limit price is < lowest offer, sell limit price is > highest bid) that has a time in force allowing it to be placed onto a matching engine's limit order book. It is said to "rest" on the book. If the time in force is Immediate or Cancel and the order is unmarketable, it is canceled back to the participant unfilled.


3

Some exchanges have agreements with market makers to provide liquidity (the market makers often get some kind of preferential treatment in return). Often these agreements will include obligations to be actively quoting some minimum percentage of the time, on both sides of the book (bid & offer). Quoting non-marketable prices is one way to meet these ...


3

The two types of orders are called "Attributed" and "Non-Attributed". Venues will sometimes provide incentives to encourage order attribution. For example, Direct Edge has their "Edge Attribution Incentive Program" which you can read about on their price list. I believe NASDAQ has offered incentives for attribution in the past, but I don't think they do ...


2

I came across B/View which is a Java application that visualizes the order book for a single stock on a single day. It encompasses some of the basic features I would expect in such a tool. It appears to be more a demonstration than a general purpose tool.



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