back to article How one bad algorithm cost traders $440m

Knight Capital, a firm that specialises in executing trades for retail brokers, took $440m in cash losses Wednesday due to a faulty test of new trading software. This morning reports were calling it a trading “glitch", which isn’t nearly as accurate as the term I’d use: “f**king disaster". The broad outline of the story is …

COMMENTS

This topic is closed for new posts.

Page:

  1. Sigmund Fraud

    The "bid" price is what you’d pay the holder of the stock if you want to buy their shares. The "ask" price is what they’ll pay to buy those same shares from you.

    Isn't the "ask" price the price which they are asking for the shares?

    1. Steve Renouf
      Alert

      Nah... It's the other way round.

      The bid price is what they'll bid you to buy them off you - the ask price is what they'll ask you to pay for selling them to you.

      1. Anonymous Custard
        FAIL

        Re: Nah... It's the other way round.

        So the confusion's not just in the software :)

        Wouldn't it have made more sense to have the program test mode just do one trade, or perhaps a limited span of trade time (say 1s or 10s)? Wall things off, just so if things go wrong they aren't going wrong many times repeatedly? Or is that too obvious a first step in code-testing.

        Or for that matter have a dummy "market" that the thing could talk to in isolation, to test the bare-bones fundamentals? This is like testing a brand new car design by putting your family in it and dumping it on the motorway at rush-hour...

        Still nice to know in this day and age we can have rapid and highly efficient automation of even our very best cock-ups (to err is human, to really foul up you need a computer...)

        1. Anonymous Coward
          Anonymous Coward

          Re: Nah... It's the other way round.

          "Dummy market", as in "latex dummies" ;) Goo-goo :P

        2. Nigel 11
          Flame

          Re: Nah... It's the other way round.

          The obvious safety is to have a trading limit, if only for debugging! After it's done $(LIMIT) of trades, it stops, until a human has checked the goings-on. Once they're happy it's working they might set the limit to effective infinity.

          The other obvious limit is $(MAX_LOSS), but the danger there is that it might think it was making a profit when it wasn't (which appears to be pretty much what happened).

          Personally I think program trading is one of the casino-finance things which ought to be banned, or at least heavily restricted. Otherwise, sooner or later there's going to be another bug like this one with added naughts. In other words it won't just bankrupt a bunch of speculators, but it'll also do major damage to the real economy.

          1. Destroy All Monsters Silver badge
            Trollface

            Re: Nah... It's the other way round.

            > The "bid" price is what you’d pay the holder of the stock if you want to buy their shares.

            YES

            > The "ask" price is what they’ll pay to buy those same shares from you.

            NO

            > The bid price is what they'll bid you to buy them off you

            YES

            > the ask price is what they'll ask you to pay for selling them to you.

            YES

            > The ask is what the seller is asking, and the bid is what the buyer is bidding.

            YES

            > The ask is above the bid (article gets this backwards).

            RATIONALLY, YES

            > Buying "at market" means paying the asking price.

            YES

            > Selling "at market" means selling at the bid price (article gets this backwards too).

            YES

    2. JetSetJim
      Happy

      Either way...

      First rule of trading: "buy high, sell low".

      Oh, wait...

    3. Eddie Edwards
      Boffin

      Yes, those two paragraphs get it a bit mixed up. The ask is what the seller is asking, and the bid is what the buyer is bidding. The ask is above the bid (article gets this backwards). Buying "at market" means paying the asking price. Selling "at market" means selling at the bid price (article gets this backwards too).

      E.g. I am ASKING £120,000 for my house. Someone is BIDDING £100,000. Either I need to drop my asking price or he needs to raise his bid, in order to make a trade. The spread is £20,000. To buy "at market" he'd offer £120,000. To sell "at market" I'd drop to £100,000.

      1. stanimir

        The ask is *always* greater or equal to the bid unless there are few sources and an option for arbitrage - here comes the microseconds decisions/orders. Market price is getting either the bid or the ask, depending which side you are at. And of course, it might be possible to place a bid or an ask on an arbitrary price in the "book".

        I am just shocked how such basic info can be so eff'd up - makes the entire article look totally amateurish.

        Source: my job

        (+1 from me too)

    4. stanimir

      Isn't the "ask" price the price which they are asking for the shares?

      it is.

  2. Anonymous John

    I've seen one report that they've asked JPMorgan Chase & Co for financing. Why anyone would want to lend them money right now, isn't clear to me.

    1. Anonymous Coward
      Anonymous Coward

      Because the CEOs probably went to school together and the loan will be covered by tax payer guarantees anyway

  3. Steven 1
    FAIL

    As no mess'in

  4. Stanislaw
    Terminator

    Our robot servants are getting more subtle

    Clearly they have decided violence is going to be too wasteful. Economics is faster.

    Shouldn't this one be filed under Rise Of The Machines?

    1. James 51

      Re: Our robot servants are getting more subtle

      Wasn't this part of the plot in the first and third batman movies?

      1. Jabber 44
        Thumb Up

        Re: Our robot servants are getting more subtle

        Saw the third one last night, I thought I was dreaming when the report of this on the radio woke me from my slumber !

    2. Dodgy Geezer Silver badge
      Mushroom

      Re: Our robot servants are getting more subtle

      XKCD currently has a 'what-if' covering the ROTM - they call it 'robot apocalypse'. See here http://what-if.xkcd.com/5/

      Randall says that he used to work in robotics, so he knows what he's talking about, and that current robots, if they turned against us, could not kill many of us - he thinks transport systems would be the best at killing humans, and not many of those would die.

      There is no comment system on his web site for me to inform him that he's completely wrong. The best thing at killing humans is 'other humans'. And machines could easily arrange for that to happen. All our food production depends on machines, as well as our living infrastructure like gas, water and electricity. They could stop that. More importantly, as indicated in the OP, all our money is held as data on machines. All they have to do is set that to zero, and we can't run our current society.

      I reckoned that without electric machines, we couldn't even go back to the steam age, because we do not have any steam engines. We'd have to go back to about 1700. The 'carrying capacity' of the world in 1700 was about 1/10 of its current population, so we'd have to kill 9/10 of us in the fight for food. That's worse than any war, and we would probably overshoot - maybe leaving us with 1/100 of our current population.

      I reckon that would be quite an effective 'Robot Armageddon'...

      1. Iain
        Go

        Re: Our robot servants are getting more subtle

        There is an xkcd forum, it used to be linked off the main page.

        Join in the fun here: http://forums.xkcd.com/viewtopic.php?f=7&t=88073

  5. Alister

    Reminds me of something I read in a Tom Clancy novel - Debt of Honour I think it was.

    1. Anonymous Coward
      Anonymous Coward

      Oh well, at least you weren't reading a John Grisham, that's a week of part-time reading I'm never getting back.

      No-one ever tell him you were supposed to put an ending in books? I mean never mind all the technical business/law pratting around and faux-culture ;)

      1. Anonymous Coward
        Anonymous Coward

        I stopped reading Clancy when he couldn't get his European geography right.

        Getting the right name for a country's capital city is not exactly advanced research.

        1. Anonymous Coward
          Anonymous Coward

          Like Jeremy Clarkson

          "Oh I near Lake Lausanne "

          I think he meant Geneva

        2. Dave Bell

          Tom Clancy?

          Yes, he used to just believe the weapon manufacturers' specifications. Now he believes the promised delivery dates as well.

    2. 404

      Debt of Honor is was...

      .... easter egg that wiped all stock transactions in the NYSE control software- which led to war with Japan- which led to a 747 being flown into the Capital building while El Presidente was addressing both branches of Congress.

      Actually, that was the first thing I thought of @9/11 - somebody read the book.

  6. Anonymous Coward
    Anonymous Coward

    The whole point is surely that HFT is a scam intended to ensure that only companies with very deep pockets that can locate very close to the exchange servers can make money. It's equivalent to being allowed to play roulette but to place your bets even as the ball is falling into a number, and it is guaranteed to remove any element of, you know, actual investment of the "I think this iPhone thing is a really good idea, let's buy some Apple shares and see how it pans out" variety.

    The result of casino trading is that the total theoretical capitalisation of share prices exceeds the entire GNP by a large factor, which is pure bubble (just as at one time the theoretical value of Tokyo real estate was more than the entire theoretical value of the rest of the world).

    Knight Capital should be made to pay the lot, and HFT should be banned and replaced with stock trading on time bounds of, say, ten minutes. But that will prevent the traders from getting their bonuses back at our expense.

    1. Destroy All Monsters Silver badge
      Holmes

      Yeah but why should anyone care whether HFT?

      Actual problems only occur when fractional reserve banking with bailouts from the central banks enter the show. Then the donkey goes wild, virgins are raped and barbarians burn down the libraries. Which is of course the situation we are in.

      As politicians like votes and easy application of bandages to dead and napalmized bodies, and the left is firmly wedded to the fantasy of giving everyone free money in the name of egalitarianization, this ain't gonna be fixed. Instead, stupid ideas are emerging from stupid minds like taxing trades or forcing the number of trades per second below some arbitrary value. Sucks.

  7. This post has been deleted by its author

  8. Tim Worstal

    Intriguing.....

    It looks like it was also interacting with a new NYSE program as well. And possibly that it was that interaction which caused the problems, not the testing of the new algo alone.....

    1. Blane Bramble
      FAIL

      Re: Intriguing.....

      Surely the problem is it was buying shares and then immediately selling them at a lower price. Doesn't matter who or what you are trading with if you do that.

  9. Richard Wharram

    Did they just...

    ....put the buy and sell prices the wrong way round? Badly named columns perhaps :)

    1. Anonymous Coward
      Anonymous Coward

      Re: Did they just...

      That seems the sensible thing to me, surely the 'Ask' price should be higher in any trading entity than the 'Bid' price...... otherwise they would be the losing money hand over fist all the time?

  10. Anonymous Coward
    Anonymous Coward

    Why did it take 40 mins..

    ...for some to pull the power to the damn server!

    1. Wang N Staines
      Happy

      Re: Why did it take 40 mins..

      They went for a coffee break to pat themselves on the back for a job well done.

  11. Thomas 18
    Thumb Down

    Run for a day?

    Why would they run a test for an entire day. If it was designed to buy large quantities of stock why not just run it for 1 hour or, hell, 5 minutes first.

    1. Robert E A Harvey
      FAIL

      Re: Run for a day?

      Why run it live at all: surely it could be tested with live input data and dummy sales?

  12. Mark Allread

    What a knightmare

    1. Jemma
      FAIL

      Spellcasting...

      "d...u...m...b...f...*...*...k...s..."

      Ineptitude on a truely mindnumbing scale. Worst of all we can expect a Andrew "Apocalypse Dull" Sorkin missive on the subject soon.

  13. Crisp

    How the hell did this "feature" escape testing?

    I cannot believe that no one thought to run a simulation or a set of unit tests before unleashing this beast on an unsuspecting market.

    1. AdamWill

      Re: How the hell did this "feature" escape testing?

      They probably did. Any QA person will tell you our Rule #0, which is that everything will always go wrong. If you test a program in a test environment exhaustively for five years, testing every possible action or interaction it might ever have to undergo, and finally bash all the bugs out of it, then what you'll find out on day #1 of production is the way in which your test environment didn't _quite_ match the deployment environment.

      1. Anonymous Coward
        Anonymous Coward

        Re: How the hell did this "feature" escape testing?

        Or more likely, that the deployment environment was changed a week before you completed testing.

  14. CheesyTheClown
    WTF?

    Gamblers deserve to lose

    When you're a gambler, part of gambling is losing and taking it like a proper loser. Get shit faced and land face flat in the street.

    I really believe that giving them a break on the trades 30% over market rate is wrong. They lost, fair and square. They tried to beat the system by getting a computer program to trade automatically and as a result, they lost their asses. And before anyone talks about the innocent victims who had invested in them... They were gamblers too and they lost.

    I would love to see someone go into a Vegas casino and lose everything they own and then ask for a break under the excuse "I didn't know how to play the game". Why should the NYSE casino be any different?

    1. Graham Bartlett
      Facepalm

      Re: Gamblers deserve to lose

      Oh, it's better than that. It's going into a casino, losing your shirt, and then asking for a break with the justification "I had a system but it didn't work".

      1. Anonymous Coward
        Anonymous Coward

        Re: Gamblers deserve to lose

        Surprisingly enough, Vegas casinos do not want you to lose your shirt, it is bad publicity. They would love you to walk in with a dollar and out with a million. The publicity is worth far more than the loss and they also know several things:

        1. You are unlikely to permanently walk away so they will get a chunk of that million back.

        2. Every news station in the country (and several worldwide) will probably publicise it.

        3. Booking for their hotel/casino will significantly increase.

        4. They will make more than that million from the increased business.

        5. The publicity will last for years.

        6. There is little to no chance of anybody else doing the same.

    2. Anonymous Coward
      Anonymous Coward

      Re: Gamblers deserve to lose

      When you are a gambler you play within the rules of the game, otherwise it is called cheating.

      If the rules of the game say they get refunded for trades 30% over market rate then it is right that they get refunded.

      If the rules of the game say they can use a computer to trade automatically then they can use computers to trade automatically.

    3. Vladimir Plouzhnikov

      Re: Gamblers deserve to lose

      Be careful what you wish for.

      Any investment is a gamble, whether you invest for a microsecond or for 30 years. Your pension fund is based on investing your contributions into various assets (mostly stocks). You blanket statement "gamblers deserve to lose" then translates as "you deserve to end up without a pension". This applies to any other investments you may make in your life as well.

      1. Nigel 11
        FAIL

        Re: Gamblers deserve to lose

        Wrong.

        Gambling is investing when the expectation value for the profit is negative. Bet in a casino, and averaged over enough bets, you are losing 1/37 of your capital for each bet (in a UK casino with one zero on the wheel).

        Investing is when the expectation value for the profit is positive. You might imagine an eccentric millionaire who returned double your stake on all zeros, so you could predict that you'd be up by 1/37 for every spin of the wheel. Buy shares in a big blue-chip company, and that return is called a dividend.

        Of course, investing in companies is to some extent a matter of judgement rather than probabilistic certainty. You have to be right often enough if you're going to make a profit. A few people can even judge horses right, and for them a betting slip is an investment not a gamble. They're rare. Successful stock-market investmenting is easier, because an honestly run company is trying to make money for its shareholders, not lose them money.. (You might guess that I do not invest in banks. I've long believed banks run on the principle of "heads I win, tails you lose". )

        There's also a social benefit to investing even when it makes a loss. You're lending your money to a company that hopefully is in a business that you believe ought to be carried on. It's often said this applies only to those who buy new equity issues. Wrong. The initial investors probably wouldn't invest, if there was no way ever to sell up. A company is supposed to last longer than the few decades between having earned surplus capital, and wanting to spend it on one's retirement. The stockmarket is a mechanism that makes people more willing to invest their capital in the first place.

        It becomes less clear when instead of doing one's own investing, one delegates it to a pension fund manager or suchlike. That's because your delegate would like to put as much of your money into his pockets as he can get away with. That, however, has nothing to do with whether it's investing or gambling.

        1. Dave Bell

          Re: Gamblers deserve to lose

          There are all sorts of interesting things that come out in the math, such as the way that the Casino can win even in an absolutely fair game--they have more money and can afford a longer run of losses. And the still famous "man who broke the bank at Monte Carlo" only "broke" that particular table. They are allocated so much money and no more.

          If that program had been in casino, it would have had a hard limit on how much it could lose.

          So I've no great problem with the system having some limits built in to catch extreme conditions. Intended or not, that program ended up manipulating the market. But the speed with which everything happened: not for the first time, sets me to asking how economic theory can have any meaning for events that are too fast for a human, even the simplified rational human of theory, to comprehend. When the system is dealing faster than a human's physical reaction time, never mind the time needed to think.

          I can remember when my money took weeks to travel from my bank to a US magazine publisher, by some arcane special procedure. I can remember a man who regularly travelled to buy goods in the USA, at auctions, and carried cash because the banking system couldn't keep up with him. Now getting the money around the world can be almost instant.

          My acquaintance can still be standing at a different auction every day, bidding against people he can see. That market hasn't changed. They money just gets delivered more easily But the stock markets have become inhuman virtual spaces. Can you look at the other computer and see the giveaway twitch of an eye that tells you your next bid could win?

          (I got the chance to read some of the latest work from Charlie Stross, a book built around interstellar trade, where the distinction between fast and slow money is hugely significant. And the hero is an accountant. Should be in print next summer--book publishing is still about slow money.)

        2. Vladimir Plouzhnikov

          @AdamWill and Nigel11

          Oh, no, guys, please don't deceive yourself.

          Whether you invest on a whim or after a careful research and deliberation, whether in stocks, oil, gold or land - any of that is taking a risk and that is what a gamble (aka speculation) is.

          Google for a definition of gamble and the applicable result is "an enterprise undertaken or attempted with a risk of loss and a chance of profit or success."

          In general, any position in the market that increases your risk (exposes you to the market fluctuation of value) is a speculative position and any position that decreases that risk is a hedging position.

          There is nothing wrong with speculation/gamble if it's done properly and in a controlled way and it is impossible to make a return without taking risk, so gamble is an inevitable part of our lives. And if someone thinks that he never gambles/speculates he should think twice because even if he doesn't do it directly, someone else does it for him. Which is what I said in my first post.

      2. AdamWill

        Re: Gamblers deserve to lose

        "Your pension fund is based on investing your contributions into various assets (mostly stocks). "

        That's an assumption too far. Many people have control over the investment of their pension fund. I do; I could put the whole thing in gold or government bonds if I wanted to.

  15. Why Not?
    Facepalm

    Nick Leeson Software inc.

    You would have thought part of the Algorithm would be to set boundaries of maximum trades?

    I assumed that all stock exchanges had a test area where such things could be verified prior to going live?

Page:

This topic is closed for new posts.

Other stories you might like