"We risk becoming the best informed society that has ever died of ignorance"
- Rubén Blades

"You can't make up anything anymore. The world itself is a satire. All you're doing is recording it"
- Art Buchwald

"It's getting exciting now, two and one-half. Think of everything we've accomplished, man. Out these windows, we will view the collapse of financial history. One step closer to economic equilibrium"
- Tyler Durden

"It is your corrupt we claim. It is your evil that will be sought by us. With every breath, we shall hunt them down."
- Boondock Saints

Saturday, October 8, 2011

Flash From The Past

Source: NANEX - "THE KNIFE" Algo From The May 6, 2010 Flash Crash

With all this talk I've had lately of HFT and the danger it brings to the game but at the same time the profit opportunities available to those who know about it, I draw your attention to the original post from Tyler himself in reference to the now infamous Quote Stuffing.  I only edited the spacing of the paragraphs for ease of viewing.  Keep mind this all private people, creating things on their own.  This isn't the government or the regulators.  Still feeling so sure that the government can give you Shelter From The Storm



How HFT Quote Stuffing Caused The Market Crash Of May 6, And Threatens To Destroy The Entire Market At Any Moment

Tyler Durden's picture
Even as the idiots at the SEC mope about cluelessly, confirming they deserve not one cent of taxpayer money to fund their massively overbloated budget, and should all be summarily fired to collect tarballs in the Gulf of Mexico (and soon Maine), our friends at Nanex have conducted an exhaustive analysis (must read for everybody concerned about market structure), in which they identify the various parties responsible for the market crash, and, drumroll please, High Frequency Trading stands at the pinnacle of culprits for the 1,000 point Dow drop. From their findings: "While analyzing HFT (High Frequency Trading) quote counts, we were shocked to find cases where one exchange was sending an extremely high number of quotes for one stock in a single second: as high as 5,000 quotes in 1 second! During May 6, there were hundreds of times that a single stock had over 1,000 quotes from one exchange in a single second. Even more disturbing, there doesn't seem to be any economic justification for this. In many of the cases, the bid/offer is well outside the National Best Bid/Offer (NBBO). We decided to analyze a handful of these cases in detail and graphed the sequential bid/offers to better understand them. What we discovered was a manipulative device with destabilizing effect." In other words: enough with all the bullshit about HFT as a liquidity provider mechanism: in reality this is just a facade for the most insidious, computerized market manipulative device ever created. Nanex' conclusion: "What benefit could there be to whomever is generating these extremely high quote rates? After thoughtful analysis, we can only think of one. Competition between HFT systems today has reached the point where microseconds matter. 

Any edge one has to process information faster than a competitor makes all the difference in this game. If you could generate a large number of quotes that your competitors have to process, but you can ignore since you generated them, you gain valuable processing time. This is an extremely disturbing development, because as more HFT systems start doing this, it is only a matter of time before quote-stuffing shuts down the entire market from congestion. We think it played an active role in the final drop on 5/6/2010, and urge everyone involved to take a look at what is going on. Our recommendation for a simple 50ms quote expiration rule would eliminate quote-stuffing and level the playing field without impacting legitimate trading."We present the Nanex' full report (please focus particularly on Part 4 and the provided evidence) and urge all readers, as we have many times before, to end all stock trading activities immediately (which at the macro level are nothing but a reflection of the EURJPY trade anyway) until such time as the SEC, CFTC, Finra, and every other corrupt and captured agency finally does something about the HFT menace. Doing nothing is merely inviting certain disaster yet again, and a guaranteed market crash, which next time wipe out the entire market permanently and destroy all confidence in US capital markets in perpetuity.

Analysis of the "Flash Crash"
Date of Event: 20100506
Complete Text

There are 9 exchanges that make markets in NYSE listed stocks: NYSE, Nasdaq, ISE, BATS, Boston, Cincinatti, CBOE, ARCA and Chicago. Each exchange submits a bid and/or offer price for each stock they wish to make a market in. The highest bid price becomes the National Best Bid and the lowest offer price becomes the National Best Ask. Exchanges compete, fiercely at times, to become the best bid or offer because that is where orders will be sent for execution. Exchanges also go to great lengths to ensure they avoid crossing other exchanges (bidding higher than others are offering, or offering lower than others are bidding), because if they do, many High Frequency Trading (HFT) systems will immediately execute a buy/offer and capture an immediate profit equal to the difference. Today, it is very rare to see markets crossed in stocks for longer than a few milliseconds.  Beginning at 14:42:46, bids from the NYSE started crossing above the National Best Ask prices in about 100 NYSE listed stocks, expanding to over 250 stocks within 2 minutes (See Part 1, Chart 1-b). Detailed inspection indicates NYSE quote prices started lagging quotes from other markets; their bid prices were not dropping fast enough to keep below the other exchange's falling offer prices. The time stamp on NYSE quotes matched that of other exchange quotes, indicating they were valid and fresh.  With NYSE's bid above the offer price at other exchanges, HFT systems would attempt to profit from this difference by sending buy orders to other exchanges and sell orders to the NYSE. Hence the NYSE would bear the brunt of the selling pressure for those stocks that were crossed.  Seconds later, trade executions from the NYSE started coming through in many stocks at prices slightly below the National Best Bid, setting new lows for the day. 

(See Part 1, Chart 2). This is unexpected, the execution prices from the NYSE should have been higher -- matching NYSE's higher bid price, unless the time stamps are not reflecting when quotes and trades actually occurred.  If the quotes sent from the NYSE were stuck in a queue for transmission and time stamped ONLY when exiting the queue, then all data inconsistencies disappear and things make sense. In fact, this very situation occurred on 2 separate occasions at October 30, 2009, and again on January 28, 2010. 

(See Part 2, Previous Occurrences).  Charting the bid/ask cross counts for those two days reveals the same pattern as 5/6! Looking at the details of the trade and quote data on those days shows the same time stamp/price inconsistencies.

The NYSE stated
that during the same intervals, they were experiencing delays in disseminating their quotes!  In summary, quotes from NYSE began to queue, but because they were time stamped after exiting the queue, the delay was undetectable to systems processing those quotes. On 05/06/2010 the delay was enough to cause the NYSE bid to be just slightly higher than the lowest offer price from competing exchanges, butsmall enough that is was difficult to detect (See Part 3, The Evidence). This caused sell order flow to route to NYSE -- thus removing any buying power that existed on other exchanges. When these sell orders arrived at NYSE, the actual bid price was lower because new lower quotes were still waiting to exit a queue for dissemination.This situation led to orders executing against whatever buy orders existed in the NYSE designated market maker (DMM) order book. When an order is executed, the trade is reported to a different system (CTS) than quotes (CQS). Since trade report traffic is much smaller than quote traffic, there is rarely any queueing or delay.  Because many of the stocks involved were high capitalization bellwether stocks and represented a wide range of industries, and because quotes and trades from the NYSE are given higher credibility in many HFT systems, when the results of these trades were published a few milliseconds later, the HFT systems detected the sudden price drop and automatically went short, betting on capturing the developing downward momentum. This caused a short term feed-back loop to develop and panic ensued.Some trading firms have stated that they detected a problem with the accuracy of the data feed and decided to shut down which further reduced liquidity. We think the delay in NYSE quotes was at the root of this detection.

On the subject of HFT systems, we were shocked to find cases where one exchange was sending an extremely high number of quotes for one stock in a single second -- as high as 5,000 quotes in 1 second! During May 6, there were hundreds of times that a single stock had over 1,000 quotes from one exchange in a single second. Even more disturbing, there doesn't seem to be any economic justification for this. In many of the cases, the bid/offer is well outside the National Best Bid/Offer (NBBO). We decided to analyze a handful of these cases in detail and graphed the sequential bid/offers to better understand them. What we discovered was even more bizarre and can only be evidence of either faulty programming, a virus or a manipulative device aimed at overloading the quotation system. You can see our results in Part 4, Quote Stuffing.

Recommendations:
  1. Quote and trade data must be time stamped by the exchanges at the time it is generated. This will ensure delays can be detected by everyone. Reasoning: Changing the procedure to time stamp at the time a quote or trade is generated is a near trivial exercise. It probably comes as a surprise to many that time stamping isn't done that way now.
  2. Quote-stuffing should be banned. Reasoning: It is a manipulative device designed to overload the quotation system. Quote and trade dissemination (data feed) is a finite resource, and should be treated as such.
  3. Add a simple 50 millisecond quote expiration rule: a quote must remain active until it is executed or 50ms elapses. If the quote is part of the NBBO, it may be improved (higher bid or lower offer price) at any time without waiting for the expiration period. Reasoning: The exchanges must protect the integrity of the National Best Bid/Offer system. What is the point of having a National Best Bid/Offer, if not everyone in your nation (apologies to Alaska/Hawaii) can reasonably execute a trade against it? 50ms is approximately the time it takes light and electronic communication to travel from New York to California and back. It is impossible to transmit information any faster. This rule would not limit quote/trade rates. So long as trades are executing, quotes can update thousands of times a second. Only a small percentage of quotes today would be affected and the potential for catastrophically high rates would be eliminated.