High-Speed Trading Firm Deleted Some Code by Accident
Today is the end of the Securities and Exchange Commission's fiscal year, as you might have guessed from the rush of enforcement actions finalized today. I count almost $68 million of penalties coming into the SEC's coffers on the last day of fiscal 2015, from three separate settlements with 25 defendants. One of those settlements was with Latour Trading, the big high-frequency trading firm, for what the SEC calls "market structure rule violations."
A popular story about the speedy computerized modern stock market is that it is dominated by evil high-frequency traders who take advantage of market fragmentation and complexity to rip off mom and pop investors. The particular villains in that story tend to be a bit hazy, but surely Latour is high on the list. Latour, a part of Tower Research, is huge, "opaque," run by an eccentric rich person, and has been in trouble with the SEC before. And is in trouble with the SEC again. Surely if anyone is ripping off mom and pop, it's Latour.
And yet today's enforcement order doesn't support that narrative. It's actually kind of the reverse. Here's the basic story of what Latour did. There are lots of stock markets. Some are big, like Nasdaq and the New York Stock Exchange. Others are teeny, like the Chicago Stock Exchange (CHX), which represents about half of one percent of trading in U.S. equities; "NYSE MKT" (formerly the American Stock Exchange), which represents even less; or the National Stock Exchange (NSX), which represented about 0.2 percent before it gave up and shut down last year.
But even the teeny exchanges are part of the SEC's "national market system," and a cornerstone of that system is the "order protection rule," Rule 611 of Regulation NMS. That rule says that, if you want to buy 100 shares of XYZ stock, and those shares are offered for $10.00 on one exchange, you can't buy them for $10.01 on another exchange. So even though CHX has just a tiny share of the market, you're not allowed to ignore it: If it's got the best price, you have to trade on CHX before going elsewhere.
But let's say you want to buy 1,000 shares of XYZ. You start by buying the 100 shares on offer for $10.00 at CHX, if those are the only shares on offer anywhere for $10.00. Then you keep going. You buy the 200 shares on offer for $10.01 at NYSE, and the 200 shares on offer for $10.01 at Nasdaq. Then you buy the 200 shares on offer for $10.02 on BATS, and the 100 on offer for $10.02 at Direct Edge. Then you buy the 50 for $10.03 at NYSE MKT, and 150 more for $10.03 at Nasdaq. Then you're done.
Hahahahaha no that doesn't work at all! If you actually did that -- buy all the shares at one price on one exchange, then go to another exchange to buy all the shares at the next price, and keep going through all of the 11 exchanges until you've bought all the shares you want -- then, and forgive the language here, high-frequency traders would race ahead of you to change their orders. If you bought some shares on one exchange for $10.00, and then some more on another exchange for $10.01, and then some more on a third exchange for $10.01, then by the time you got to the fourth exchange that $10.02 price wouldn't be there any more. Electronic traders would have figured out that there was a big buyer, and they would have updated their prices to reflect that, meaning that the offers that used to be displayed would disappear before you could access them. By showing your hand like this, you'd drive up the price you'd pay for the shares.
The simple fix is to buy all those shares at the same time: If you know that there are 1,000 shares available at prices from $10.00 to $10.03 on various exchanges, you should try to buy them all at once. But the order protection rule seems to prevent that: If you send an order to NYSE to buy those 200 shares at $10.01, it won't let you trade, because it sees a protected quote for shares available for $10.00 elsewhere.
So there is a slightly more complicated fix, which is that you can buy all the shares at the same time, if you promise all the exchanges that that's what you're doing. This is Rule 611(c) of Regulation NMS, which allows for "intermarket sweep orders." ISOs are sort of an exception to, or a special case of, the order protection rule. If you send an order to all the exchanges at once, and mark it as an ISO, then all of the exchanges know that they're not responsible for worrying about protected quotes. NYSE can sell you those shares at $10.01, because you've promised NYSE that you are simultaneously buying all the shares available for $10.00 at CHX.
But you have to actually do that: You need to send all the orders to all the other exchanges to make sure that you don't trade through any protected quotes. The problem is that Latour messed up this process, in fairly technical and mostly accidental ways.
The main thing it got wrong stemmed from the fact that it was not directly connected to every exchange. The SEC says: "During the relevant time period, Latour was not a member of and thus could not send orders directly to the Chicago Stock Exchange ('CHX'), the National Stock Exchange ('NSX'), and the American Stock Exchange (later renamed 'NYSE MKT')," three exchanges that combined for about 1 percent of equity trading volume. You can see why Latour didn't feel like paying to connect to them. So when it needed to send ISOs to all the exchanges, it couldn't send them directly to CHX, NSX and Amex/NYSE MKT. Instead:
When Latour was required under Reg NMS to send an ISO to one of these exchanges, it sent a “directed ISO” to one of the exchanges operated by BATS Global Markets, Inc. (“BATS”). A directed ISO instructs BATS to route the ISO upon receipt to the exchange specified in the order instructions (in this case, CHX, NSX, or NYSE MKT).
All of this, of course, happened automatically: Latour's algorithms were deciding what to buy, and where, and how, and when they decided to buy shares via an ISO, the algorithms sent out all the instructions. Unfortunately, one day a developer at Tower/Latour was making an unrelated change to the trading software, and saw the code responsible for those directed ISOs, and didn't understand what it did, and just deleted it:
In the course of examining the software code to make the requested change, the Core Engineering developer observed a difference in how the code translated orders to be sent to BATS’ U.S. exchanges as compared to those to be sent to BATS’ European exchange. The developer then eliminated some of the code sequences that he believed created an operational inefficiency.
The code sequences that the Core Engineering developer eliminated, however, were crucial to the proper translation of directed ISOs that Latour sent to the trade server application using the new internal messaging protocol. In particular, as a result of the coding change, which went into effect in July 2011, the BATS trade server application dropped the routing destination when it translated any such directed ISO into an order message to send to BATS.
The Core Engineering developer did not understand that the changes he made to the code sequences would affect the directed ISOs generated by Latour’s trading algorithms.
Oops! This is a good application of Chesterton's fence: If you work at a high-frequency trading firm, and you don't understand what some code does, don't delete it! Figure out what it does before you delete it.
Latour's other mistake is even more boring and technical than that one. Basically in deciding where to send ISO orders, Latour's algorithms looked to see which exchanges had protected quotes. But Latour knew that sometimes exchanges were slow to update their quotes. If, for instance, NYSE showed an offer for 100 shares at $10.01, and Latour sent an order to buy those shares, and the order came back cancelled because no shares were available, and NYSE still showed that offer, Latour would assume -- not necessarily unreasonably -- that the offer was no longer available (because otherwise its order would have been filled), and that NYSE's data feed just hadn't been updated yet. (All of this is occurring in the space of milliseconds.) And so if it was sending a new ISO a few milliseconds later, it felt free to ignore the protected quote at NYSE, on the assumption that it was a phantom quote that had already vanished. This is actually explicitly allowed by SEC guidance, but Latour accidentally messed it up in really quite eye-glazingly dull ways that I will quote in a footnote for serious masochists.
Here again, notice that the problem Latour was trying to solve was one often noted by critics of high-frequency trading: Market data feeds are sometimes outdated, and the shares that seem to be available often aren't. Latour wanted to buy the shares that the exchanges were offering, but it knew from bitter experience -- the experience of a few milliseconds ago -- that those were phantom offers, and that those shares were no longer available. So it took steps to protect itself against those phantom offers. It messed those steps up a bit, but the intent was not to rip off mom and pop investors. It was to avoid getting ripped off itself.
The thing about Latour is that it is big and does a lot of trades, so when it messed up a few lines of code, it messed up a whole lot of trades. The SEC says:
Latour sent nearly 12.6 million non-compliant ISOs between October 2010 and August 2014. These non-compliant ISOs caused approximately 1.1 million trade-throughs and 1.7 million locked or crossed protected quotations. Latour received $2,784,875 in gross trading profits and exchange rebates from its non-compliant ISOs.
I don't quite know how the SEC measures those ill-gotten gains, but in any case they're pretty small for a firm that accounts for a significant fraction of U.S. equity trading. Tower will have to pay back those gains, plus interest, plus a $5 million penalty, for a total of more than $8 million.
One moral of the story is, of course, be careful with your computer code! But the other is something like: High-frequency trading firms are not so different from you and me and mom and pop. Even the firms whose job it is to understand and deal with and take advantage of market complexity are sometimes confounded by the complexity, the fragmentation and the speed of modern markets.
- Settlements with 22 underwriters over municipal bond due diligence, for small amounts totaling about $4.1 million.
- Settlements with Focus Media Holding Limited and its chief executive officer for a total of $55.6 million.
- The $8.1 million Latour settlement discussed in the text.
There is also an enforcement action charging"two former executives of ContinuityX Solutions Inc. with fabricating nearly all of the company’s revenue and enriching themselves in the process," which sounds like great fun, but which did not settle.
From the SEC order:
Latour Trading LLC (“Latour”), a U.S.-based broker-dealer, has been registered with the Commission since July 2009. Latour does not have any customers and engages only in proprietary trading. Until January 2014, Latour was wholly owned by Tower Research Capital Investments LLC, and its managing member was Tower Research Capital LLC (“Tower Research”), a firm that engages in quantitative investment strategies through affiliates (“trading teams”) that trade on multiple domestic and foreign markets. In January 2014, Tower Research Capital Investments LLC assigned all of the issued and outstanding interests of Latour to Tower Research.
"Latour's trading at times accounted for as much as 9 percent of the trading volume in equity securities for the entire U.S. market," said the SEC the last time Latour was in trouble. This time it says:
During the period from October 2010 to April 2015, Latour sent over 12.8 billion orders to U.S. exchanges, approximately 233 million orders on average per month.
"Right now, IEX is a choice that people may or may not make," Katsuyama said. "As an exchange, you’re part of the National Market System. It becomes an obligation if you’re the best price to send the order. It goes from optional to mandatory."
Warning: Everything that follows is super stylized and simplified!
It used to be that when his trading screens showed 10,000 shares of Intel offered at $22 a share, it meant that he could buy 10,000 shares of Intel for $22 a share. He had only to push a button. By the spring of 2007, however, when he pushed the button to complete a trade, the offers would vanish. In his seven years as a trader, he had always been able to look at the screens on his desk and see the stock market. Now the market as it appeared on his screens was an illusion.
An ISO is defined in Rule 600(b)(30):
Intermarket sweep order means a limit order for an NMS stock that meets the following requirements:
(i) When routed to a trading center, the limit order is identified as an intermarket sweep order; and
(ii) Simultaneously with the routing of the limit order identified as an intermarket sweep order, one or more additional limit orders, as necessary, are routed to execute against the full displayed size of any protected bid, in the case of a limit order to sell, or the full displayed size of any protected offer, in the case of a limit order to buy, for the NMS stock with a price that is superior to the limit price of the limit order identified as an intermarket sweep order. These additional routed orders also must be marked as intermarket sweep orders.
From today's order:
A trading center that receives an ISO may execute the order immediately, even if doing so would appear from the perspective of the trading center to trade-through the protected quotations at one or more other trading centers. Under Rule 611, by marking an order as an ISO, a broker or dealer represents to a trading center that it has sent all of the necessary orders to execute against the pertinent protected quotations displayed at other trading centers. Rule 611(c) imposes an affirmative obligation on brokers or dealers sending ISOs to take reasonable steps to establish that they have satisfied the requirements of sending an ISO, i.e., sending all of the necessary orders to execute against the pertinent protected quotations.
Technically you need to "take reasonable steps to establish that" you've sent the order everywhere. You are not strictly liable for never trading through a protected quote. But exactly what the "reasonable steps" are is I suppose a matter of some uncertainty, and one thing established by today's enforcement action is that Latour's steps were, overall, inadequate.
This is pretty tenuously related, but here is an AI koan that I think about a lot:
A novice was trying to fix a broken Lisp machine by turning the power off and on.
Knight, seeing what the student was doing, spoke sternly: “You cannot fix a machine by just power-cycling it with no understanding of what is going wrong.”
Knight turned the machine off and on.
The machine worked.
From the SEC's order:
In adopting this functionality, Latour relied upon written guidance provided by the Division of Trading and Markets. See Reg NMS FAQs, Question 4.06 (“Yes, waiting one full second to route a new ISO to an unchanged price at a trading center (after receiving a no-fill or partial fill cancellation of a previous ISO seeking to execute against a protected quotation at such trading center) would qualify as a reasonable policy and procedure under Rule 611(a)(1) to prevent trade-throughs, as well as a reasonable step under Rule 611(c) to establish that orders meet the requirements for ISOs set forth in Rule 600(b)(30).”).
First, Latour failed to account for circumstances in which it sent an ISO to execute against a protected quotation but its order executed against a better-priced, non-displayed order (i.e., a hidden order) instead of the protected quotation. Such executions did not result in any changes to the protected quotations because the protected quotations had not been removed. Yet, because Latour was waiting to see a change to that protected quotation in the quote data before it stopped relying on the previously-sent ISO, Latour did not send a new ISO when it was required to do so under Reg NMS or exchange rules adopted pursuant to Rule 610 of Reg NMS.
Second, with regard to certain exchanges, Latour failed to account for executions against protected quotations that were the initial displayed quantity of a reserve order. So long as such an order has sufficient quantity in reserve, an execution will result in the protected quotation being immediately replenished at the same price and quantity. The exchange then sends data indicating that a new displayed protected quotation exists at the same price and quantity. In the quote snapshot assembled for a new ISO decision, such a replenished protected quotation will bear a new timestamp. However, for three exchanges, the Tower Research data servers used by Latour had not been programmed to recognize the replenishment of a reserve order. As a result, for these exchanges, the new quote snapshot reflected a protected quotation with the same timestamp as the one used for the previous ISO decision. Latour erroneously assumed that the executed previously-sent ISO removed that quotation, but that, owing to latencies, the exchange had not yet sent an updated quote.
The question here is not whether Latour traded through protected quotes -- it did! -- but whether it took "reasonable steps" to avoid doing that. The SEC seems to think that the procedures described above were unreasonable. I ... cannot express an opinion. I can hardly bear to read about them.
Also, check your work! Latour really should have caught the directed ISO thing, because it never got back executions from CHX, NSX or NYSE MKT on its ISOs. But:
Latour’s post-trade surveillance tools did not use the ISOs that Latour sent to the exchanges. Instead, Latour chose to use its internal version of the ISOs as they existed before they were translated into the unique messaging formats used by the respective recipient exchanges. As a result of using this pre-translation version, Latour applied its post-trade regulatory compliance tools to the orders it intended to send to the exchanges and not the orders that it actually sent. Accordingly, Latour did not detect that the ISOs it intended to send to BATS as directed ISOs did not, in fact, reach their necessary destinations.
This column does not necessarily reflect the opinion of the editorial board or Bloomberg LP and its owners.
To contact the author of this story:
Matt Levine at firstname.lastname@example.org
To contact the editor responsible for this story:
Zara Kessler at email@example.com