Tag Info

Hot answers tagged

15

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 ...


10

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 ...


9

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 ...


8

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 ...


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

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.


7

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. ...


6

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

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

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 ...


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

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 ...


5

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 ...


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

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 ...


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.


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

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 ...


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

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 ...


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.


2

From the Turquoise features document: 6.3. Away Market Best Bid and Offer (ABBO) 6.3.1. The ABBO is defined as the Best Bid and Offer prices as represented by an aggregation of relevant European Order Books as defined by Turquoise. An external market’s Best Bid and Offer will only be part of the ABBO when that market is in Continuous Trading. ...


2

In regards to size: I assume that you would most likely want to structure the software to implement each 'book' as a unit of orders representing that particular security, and possibly (as mentioned above) further divide these structures into individual pricing structures such-structures. You would want to be able to scale each individual 'unit' to a pretty ...


1

Assuming your question is about using the FX 'volume' you see in a broker's DOM or T&S window, you probably can't infer much about order flow in the way you can with other instrument types. FX volume and tick data are not equivalent to what you will see for other instruments. That is, unless the feed is coming from a FX ECN like HotSpot or ...


1

One way to think about this is as a missing data problem. You observe the order book constantly, but trades only occur infrequently. One way to resolve this is to perform full information maximum likelihood (other techniques, such as multiple imputation, may be too slow for your needs but it might be useful to look into them), which has analytical formula ...


1

Despite the rather unconventional terminology used I would say you are pretty much spot on with what you are doing and what you try to achieve. I would, however use log returns in order to get an identical percentage no matter whether you measure the distance from 100 -> 90 or 90 -> 100, for example. You can also standardize the value you capture by ...


1

I would actually not bother with F# data structures for this - many of them are actually slower than ordinary .NET collections. My approach is to use SortedDictionary<price,volume> for bids and asks. That way, you always know the best prices on the market. Of course, the above assumes that you're not concerned with thread safety and are building the ...



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