Thursday, August 09, 2012

Another Algorithmic Market Failure

In 2009, Matt Cushman, Managing Director at Knight Equity Markets, gave a seminar at Northwestern on "High Frequency Trading". Here is the abstract:
High frequency trading has emerged over the past decade as a critical component of modern electronic financial markets. It provides liquidity, efficiency and stability to the global equities, foreign exchange, futures and other electronic marketplaces. By some accounts, two-thirds of US equity shares traded are done by high frequency systems. Yet, misconceptions abound in the popular media today concerning high frequency trading's impact and value to the broader economy.
We will discuss the value of high frequency trading, and some of the problems (both quantitative and technological) that must be solved to operate a successful high frequency system.
Much of the talk focused on how Knight put its servers close to those of the NYSE so it could be first in line for trades. I failed to see the societal value. Say at the airport if someone cuts in front of the security line, they get considerable extra value but it will be cancelled out by the lost time of everyone behind him.

The company, now called Knight Capital, tried out a new algorithm last Friday and lost $440 million buying when it should have sold.

I cry no tears for Knight but such losses can have a disastrous effect on the stability financial markets. One solution is to have the government or some other agency verify code before traders can use it on the markets. But code verification is practically difficult and theoretically impossible.

I would prefer a tiny transaction tax on every trade, negligible for all but high-frequency traders. Computation has made the market nearly frictionless, time to but some friction back in.

18 comments:

  1. "I cry no tears for Knight but such losses can have a disastrous effect on the stability financial markets."

    I'm not arguing for the positive effects of Knight, but what negative effect did this actually have? Even during the far more widespread "flash crash" of 2010, the markets were back where they should have been quite quickly.

    ReplyDelete
  2. Could you be a bit more specific about the effect on the stability of financial markets?

    I looked at the last two HFT events, and I didn't see any noticeable effect on anything other than Knight's stock price. But if you have better info, I'd love to see it.

    http://www.chrisstucchio.com/blog/2012/flash_crash_flash_in_the_pan.html

    ReplyDelete
  3. A tax has unintended consequences on the border between "=0" and ">0", so in some sense it can't be tiny enough. Instead I would just instruct NYSE to have a 60-120 second delay, chosen uniformly at random, before an incoming transaction is processed (given the stakes and money involved NYSE can afford a "luxurious" truly random source such as atom decay). That would force a change in the way trading AIs are programmed.

    ReplyDelete
  4. One HFT firm going down does not matter too much. Knight is large, but there is lots of competition. We don't need more regulation or taxes. And HFT firms can test their own code (or write code to detect and exploit failures in other firms' software). Just keep the firms from getting too large, to keep the competition. Break Goldman Sachs, Citibank and other taxpayer-subsidized TBTF firms into pieces.

    ReplyDelete
  5. Raging Bulls: How Wall Street Got Addicted To Light-Speed Trading
    Jerry Adler | Wired | 3 August 2012

    Outstanding article on high-frequency trading. "Stock quotes are always to the penny, but real prices can go to six decimal places. No sane person would haggle over a ten-thousandth of a cent. But computers don’t get bored" via @TheBrowser http://b.rw/PGKiki

    ReplyDelete
  6. Mike Wellman has the right solution to this. Not a tax but a delay, of sorts. Namely, use a call-market with one-second granularity instead of continuous trading. http://blog.messymatters.com/wellmanblog

    ReplyDelete
    Replies
    1. Oops, that's what I get for manually typing links.

      http://messymatters.com/wellmanblog

      Delete
    2. I agree that Mike's solution is the right approach. One issue with it though is that a one-second call market may handle low liquidity less gracefully than the CDA. Is there a hybrid approach? Actually, for public company stocks I don't see why once-a-day call auctions wouldn't be plenty.

      It's hard for me to imagine how high frequency traders make a lot of money. At that time scale, they are essentially playing a zero-sum game amongst themselves.

      Delete
    3. Dave Pennock: "It's hard for me to imagine how high frequency traders make a lot of money. At that time scale, they are essentially playing a zero-sum game amongst themselves."

      ----------------

      Your reasoning is correct David Pennock.

      And therefore, we should all be thinking "scam". Because "If it seems too good to be true, it *is* to good to be true."

      Somewhere, folks are losing mdash; in a more-or-less non-obvious way that is a key element of the scam mdash; by high-frequency trading.

      Who is it that is losing, the world wonders?

      Delete
  7. These days trading vol are already decreasing. I don't think adding transaction tax will solve any problems.

    ReplyDelete
  8. A better tax would be a tax on twitter. This way only the relevant comments with thinking behind them would surface.

    ReplyDelete
  9. Stability of financial markets? If you were around during the crash of 1987, when all trading was done on the floor of the NYSE, you would have a very different view of relative stability of financial markets then and now, with algorithmic trading.

    Sure HFT mistakes are fast, but the recoveries are fast as well. If you couldn't sell your stocks in 1987 when things crashed 20%, you would be willing to sell them even lower as the panic ensues. HFT makes sure those things don't last as long as they once did. It takes a model to beat a model. HFT is not perfect, but its predecessor was worse. People hate HFT because of the money mentioned, but people forget that the old specialists (people traders) used to make quite a bit more money.

    Taxes are a poor idea. In HFT, the calculus goes like this…a fair price for the stock is estimated, and you put your bid and ask such that the margin you gain vs the fair price is an appropriate profit. If there are fees (such as exchange fees) they are simply added to the margin that you charge. You might have guessed by now that I used to work at an HFT shop.

    If you add a tax, the margin will simply be increased. Do you know who pays those taxes? It's the retail investor who trades with the HFT algorithms. If normally, an HFT system is willing to buy Microsoft for 20.02 and sell it for 20.04, a tax will simply make the HFT firm be willing to buy it for 20.00 and sell it for 20.06. That means a grandmother selling her stock will get 2 cents less than she would without a tax.

    Adding latency? Why? Faster quotes being sent to the market mean by the time someone interacts with the price, it is the fairest, most up to date price known at the time. This is important. I am not arguing that millisecond speed differences are the most important societal thing in the world, but it isn't bad either. It's like asking for the news 1 millisecond slower. Sure you can do it, and it doesn't have much societal value to know the olympics 1 millisecond faster, but it's a waste of time to do.

    ReplyDelete
    Replies
    1. "If normally, an HFT system is willing to buy Microsoft for 20.02 and sell it for 20.04, a tax will simply make the HFT firm be willing to buy it for 20.00 and sell it for 20.06. That means a grandmother selling her stock will get 2 cents less than she would without a tax."

      This didn't quite make sense to me: If it's not profitable anymore for the HFT company to do arbitrage between 20.02 and 20.04, the prices will stay at 20.02 and 20.04 instead of stabilizing to 20.03. It means that a grandmother will get either 20.02 or 20.04, depending on where she sells, instead of 20.03. There is no overall benefit to the grandmother, and possibly there is damage if she is smart enough to pick the more profitable place to sell.

      Delete
  10. Also, the cutting the line in airport security analogy is deeply flawed. It is not a zero sum game between you and HFT. It IS a zero sum game between an HFT firm and another HFT firm, or an HFT firm versus people specialist traders. You think that burly guy from queens who used to be a janitor and now works on the floor of the NYSE will give you a good price? HFT cuts the line in the sense that it competes with him to give you a better price. HFT competition to be fast is no different from Mcdonalds lowering their price to fight with Burger King…in essence, HFT firms are fast to compete for your business.

    When the world changes, prices change as well. As an HFT firm, you are always sending prices that are competitive for customers, like a retiree who wants to sell his stock. HFT being fast is the effort to improve prices as quickly as possible, or admittedly, pull prices if they are no longer fair. Often, this is a typical scenario for an HFT firm…news comes out on a stock that is positive. The old bid for the stock was 20.00. That means if you are sending an order to sell your shares in the stock, to say, raise money to send your kids to a good college, you will hit the bid at 20.00. If HFT is not fast, you will get $20 for your share, even though the news hit 2 seconds ago. HFT algorithms compete for your business in the sense that they try to be fastest to improve that bid price to 20.05. If they are not fast, you get $20. If they are fast, then you get $20.05. What is the problem here?

    I think people look at the profits of HFT and they assume somehow they are being taken advantage of. That is simply incorrect. The biggest fights in HFT are between each other in a race to see who can provide the most competitive prices to a customer. Sure you make money doing so, just like any other enterprise in capitalism, but the end user pays a lot, a lot, a lot less than they used to when people traders gave you prices in 1/8's. Being able to sell or buy stocks quickly and efficiently is an important function for capital markets, and people get paid to provide that function, just like Amazon works hard to make sure your book arrives tomorrow instead of next week, or instantly if you have a kindle. Is it the most important thing in the world? No, but it is not the societal menace that everyone seems to make it out to be.

    ReplyDelete
  11. I consider transaction tax to be a kind of Pigovian tax. Too many smart people choose to become bureaucrats in the financial sector, because that's where the money is. If we could tax the financial sector so that it becomes much less profitable, many of those people would probably become scientists, engineers and entrepreneurs, creating something new. The society would probably benefit.

    ReplyDelete
  12. oh no! not a tax. let exchanges charge fees. why pay the govt for having failed to perform its job of maintaining financial stability?

    ReplyDelete
  13. I agree with Jouni completely - what a waste to have smart people spending their time on this. I haven't see a cogent argument for how HFT is beneficial to anybody except the (successful) traders themselves. Some have argued here that it is a zero-sum game. However, overall it seems that HFT is extracting some positive profit from the system, so somebody else is losing (traditional long-term investors?) As opposed to long-term investment, I don't think HFT has any net effect in moving resources towards more promising companies etc.

    It's all fine but it's also completely fine to tax it. The question is, why not tax it as much as possible? (to maximize tax revenue extracted from an otherwise useless activity, such as gambling)

    ReplyDelete
    Replies
    1. It is not a zero sum game, unless it is defined in a context that is unreasonably narrow.

      HFT, and market maker traders in general, provide liquidity to the public. They provide a service and are paid for it for sure, just like any other job.

      If you are talking about the narrow context of the trade, it is zero sum. But that is not how the world works. Bill Gates can sell a share of Microsoft to a market maker trader/HFT. Say he does this for $26.00. Tomorrow, it goes to $30.00. In the context of the trade, Bill Gates "loses" $4 to the HFT algorithm. But that is not the whole story. He took that $30 and did something with it. Maybe he helped fund a startup which has created value and doubled his money. So now the HFT trader is up $4, and Bill Gates is up $30. Zero sum, huh?

      Or maybe he invested it in a Malaria vaccination program that has no easy dollar valuation but is clearly positive to the world. This is why in the context of the system, everyone can win, and it can be a positive sum game. Very, very few people understand this.

      If you invested your savings 18 years ago for your kid to go to college, at some point you will sell that stock to raise cash and pay for college. You are investing in your child's education, so that he can have a good life, invent things, cure cancer, solve P vs NP, improve Shor's algorithm, and more. That seems like a good return, even if 4 years later the HFT algorithm you sold your stock to made money because the stock went up.

      Trading enables things like this. The world is not a zero sum game, and trading helps people with _relative_ opportunity cost differences exchange assets so that everyone can be better off.

      Time to stop the ridiculous suspicions that if a trader or algorithm is making money he must be stealing it in a zero sum way from someone else.

      Delete