Slashdot Mirror


Wall Street and the Mismanagement of Software

CowboyRobot writes "Last week, a bug in high-frequency trading software from Knight Capital Group resulted in erroneous trades costing almost a half-billion dollars. So, what went wrong and how can they, or any other software developer, prevent something similar from happening again? In hindsight, it's clear that the developers did not verify the code under enough conditions. But the real issue is how these high-frequency trades work in the first place. Robert Dewar at Dr. Dobb's suggests the financial industry needs to take a page from the avionics rulebook, which has very strict guidelines about what code can be implemented due to the high cost of failure in that field. 'High-frequency automated trading is not avionics flight control, but the aviation industry has demonstrated that safe, reliable real-time software is possible, practical, and necessary. It requires appropriate development technology and processes as well as a culture that thinks in terms of safety (or reliability) first. That is the real lesson to be learned from last week's incident. It doesn't come for free, but it certainly costs less than $440M.'"

27 of 267 comments (clear)

  1. That's What We Did by crrkrieger · · Score: 3, Insightful

    Back in the late 90s when I was system admin for a trading company, they recruited me from a place that did 911 computer aided dispatch software. My shop, at least, recognized that some of the same reliability issues were at stake, so some people get it.

    1. Re:That's What We Did by Anne+Thwacks · · Score: 4, Insightful
      You seem to assume that they want to stop the "accidents". You misunderstand the senario - the whole thing is a distributed Ponzi scheme. It works like a sort of "reverse pass the parcel". Each transaction takes a small percentage in brokerage fees as the underlying "commodity" gains or loses value. However, over time, the brokerage fees exceed the true worth of the commodity has in real life.

      The spectacular "losses" are the path by which the money leaves investors, and is syphoned off to pay the disproportionate brokerage fees.

      As a point of reference see gold - the value of gold traded between speculators each day is 1,000 times the value actually sold into industry/jewelery/etc - so a 0.25% brokerage fee on both buyer an seller is worth 5* the value of the gold that enters or leaves the market each day. Obviously, the additional margin actually paid by real life users for the benefits of a liquid market is a tiny fraction of the value of the gold - sometimes there has to be a "software problem" or "rogue trader" or, to use the colloquial term "scapegoat", to provide the money distributed on brokerage fees.

      I am not suggesting any one person is responsible for this - the banks have colluded to look the other way while this system has developed in an ad-hoc manner. In all probability, many of the so called "masters of the universe" are too stupid to understand what is going on, as it requires an understanding of the laws of maths, which they generally don't have. The few "whizz-kids" who could understand are "highly motivated" to look the other way.

      --
      Sent from my ASR33 using ASCII
    2. Re:That's What We Did by somersault · · Score: 4, Informative

      From the article I read recently, they had just put a new system into place, but they weren't even watching what it did, and had no "kill switch" in place to stop it immediately if it started acting up. Crazy. Maybe the programmers screwed up, but whoever was supervising the installation and running of the thing was a moron.

      --
      which is totally what she said
    3. Re:That's What We Did by somersault · · Score: 3, Insightful

      I'm one of the least business interested type techies you can have, but even I would know that the most important thing when doing stock exchange software is making sure that it's not doing anything retarded, and cutting it off immediately if it does. That's the type of thing that terrifies the hell out of me, and why I wouldn't really want to get involved in financial programming without a lot of supervision. Then again, maybe that means that some of the programmers who go to work for these places are idiots who don't think about consequences..

      --
      which is totally what she said
    4. Re:That's What We Did by malkavian · · Score: 3, Interesting

      That's the thing about "not doing anything retarded". There's a lot of things that can fit that description. The frame problem is what killed classic AI, and it's exactly the core of this problem. And it's probably more a problem for financial trading than it is for avionics.
      To get around that, you need a base set of heuristics from the experts. That's what a spec document is for, to determine the limits and boundaries along with the exact operation. I suspect that a fair bit of this gets rushed through in the attempt to get an algorithm out that's better able to play your opposition before your opposition gets their own one out that'll toast yours.
      Political pressure comes from on high to "get things moving now, what's the hold up?", and pressure is applied to the front lines to move it.
      Which comes back to a management failure. Some things take time to get right, and you have the option of managing the environment to allow for the latency until things come out right (which is a fairly meaty task, but means you largely go from stable state to stable state), or you can utilise politics to speed things up (and this frequently means corners are cut; always a risk, hopefully calculated, frequently not). This often means going from a stable state to an uncertain one, with the hope that things won't go bad enough, and you can fix stuff on the fly.
      Programmers aren't the ones in complex enterprises that should decide what's sane and what's not. That's for the people who have the experience in the field. If that info doesn't get passed on, it's pointless blaming a programmer (hey, go program exactly what I'm thinking of without telling you, and get it right!).
      Doing things the right way takes time and money. Financials are usually willing to spend money, but they're very used to getting things "now".
      That's something they may need to re-evaluate, and go back to the more old fashioned way of doing things, and taking time to ruminate, and double check.. They'll lose the maximum possible profit point, but keep things stable and still profitable.. Alas, many of them don't consider that acceptable, and want it all, and want it now.

    5. Re:That's What We Did by timeOday · · Score: 4, Insightful
      I find the comparison to the 911 hotline or avionics (in the summary) almost offensive. This $400,000,000 "loss" is just ownership changing hands in a zero-sum game; nothing was actually destroyed. Even individual investors (who spread their bets) were probably on both the winning and losing sides.

      It's NOT the same as airplane full of people being destroyed or an ambulance failing to show up. In fact, all the money the summary suggests pouring into perfecting HFT software would be a waste and a loss to the economy overall. The real question is how can we fix the incentives to get those HFT developers back working on avionics or 9/11 call centers or something else with real value?

    6. Re:That's What We Did by somersault · · Score: 4, Insightful

      But the real problem issue here isn't even the buggy software IMO. It was the way the software was put into place, not monitored, and nobody was ready to just shut it off if it started going haywire. According to the article I read, Knight hadn't even noticed a problem themselves - it was pointed out to them by the stock exchange that they were doing a very high amount of trades compared to usual, and it still took them half an hour or more to shut everything down. There should have literally been a big red STOP button in place to shut things down if they went wrong.

      --
      which is totally what she said
    7. Re:That's What We Did by mspohr · · Score: 3, Interesting

      I think the problem is that Knight doesn't pay any fees so is free to do as many trades as possible at no cost. This makes programmed trading possible.
      If there was even a very small fee (as some people have proposed), then the high speed programmed trading would not be profitable.
      Knight and others doing this type of trading are profiting from very small changes in price which they can see from their order book. They are "front running" the market and this has been illegal but I guess it is so profitable that the authorities are encouraged to ignore the man behind the curtain.

      --
      I don't read your sig. Why are you reading mine?
    8. Re:That's What We Did by superflippy · · Score: 3, Informative

      Someone pointed me toward this article on another /. thread about the incident. Apparently, their testing program got packaged in with the code when it was deployed, and it's that test program that wreaked havoc.

      The Knightmare Explained from Nanex Research: http://www.nanex.net/aqck2/3525.html

      --
      Your fantasies contain the seeds of important concepts.
  2. Wny not just tax trades? by Anonymous Coward · · Score: 5, Insightful

    First 100 trades in a day: free
    Next 1000, taxed at 0.02%
    Next 1000, taxed at 0.1%

    And so on.

    This would do wonders for the problem.

    1. Re:Wny not just tax trades? by sycodon · · Score: 4, Insightful

      Outlaw HFTs They just pervert the market.

      --
      When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
    2. Re:Wny not just tax trades? by ShieldW0lf · · Score: 5, Funny

      If code like this works better than human judgement does, doesn't that mean we've made rich people obsolete?

      --
      -1 Uncomfortable Truth
    3. Re:Wny not just tax trades? by jedidiah · · Score: 4, Insightful

      As someone that actually stands to lose from Obama's tax policy, I understand the need to do my fair share in tough times. I also freely acknowledge that giving young families and recently graduated students more money will more likely cause money to move around the economy.

      Not everyone with money is a narcissist jackass.

      --
      A Pirate and a Puritan look the same on a balance sheet.
  3. Not a bug, but a test harness by Anonymous Coward · · Score: 5, Informative

    Reports have it that rather than releasing a buggy system, the problem was caused by running the test harness in a production environment. More here:
    http://www.theregister.co.uk/2012/08/08/knight_capital_analysis/
    http://www.nanex.net/aqck2/3525.html
    http://www.zerohedge.com/news/what-happens-when-hft-algo-goes-totally-berserk-and-serves-knight-capital-bill

  4. Completely wrong by Anonymous Coward · · Score: 5, Informative

    It wasn't HFT software, it was regular trading software. The developers created a build of the software that included a module that generated lots of silly trades as test data. The software was hooked up to the exchange as a live test to ensure it would talk to the exchange correctly. Unfortunately, they used the software build that included the test trade generator, and those test trades started executing for real.

    It wasn't actually a bug; everything worked perfectly. It was more of a configuration management problem.

    The only relevance it has to HFT is that if the NYSE limited the rate of trades then a lot less money would have been lost.

  5. And Save What? More Fantasy? by knapper_tech · · Score: 3, Insightful

    It's already such a waste that so much talent is getting thrown at problems that seek to make money while producing absolutely nothing. HFT is cleverly sanding in the middle of a river in an eddy and dipping your hand in to tap power without getting pushed downstream. What does Wall Street actually produce? What is their product? Why should we care that they periodically lose their minds and shirts? If anything HFT should be taxed into oblivion so that excellent minds aren't recruited to deliver nothing of social value.

    --
    "There are some people that if they don't know, you can't tell them." ~ Louis Armstrong
  6. Warning to execs by jerpyro · · Score: 4, Insightful

    Maybe it should serve as a warning to executives to not release buggy software. I know a lot of shops that push things out the door before they're fully baked.

    In terms of the stock market, I don't see a problem. The long-term market wasn't affected, no value was created or destroyed, and those who played the game improperly lost out big time. Short term trades on the exchange are gambling. Anyone who tells you otherwise just wants your money. Don't forget, there's always a buyer *and* a seller. Just because Knight lost $450m doesn't mean other people didn't gain $450m.

  7. Re:Not comparable by MickyTheIdiot · · Score: 5, Insightful

    Is it me or are we continuously using "profits" as a excuse for bad *anything* and pushing that idea to an extreme?

  8. Early-Breaking News: AGILITY! by Tackhead · · Score: 5, Funny

    A "safety culture" has infused the entire industry, with hazard/safety analysis a key part of the overall process. Until the software has been certified as compliant with the standard, the plane does not fly.

    Blair K., Certified Master of the Scrum, responded: "Well, that doesn't sound like a very agile process to me! "Certified" and "compliant with a standard" sound pretty waterfallish. Why not just have a 15-minute standup and decide to launch the plane? At last the aerospace industry could deliver aircraft on time and under budget."

    Customer wants their plane painted hot pink? We can totes do that, bros! Shouldn't take more than 24 hours to get to Home Depot and get a few cans of spraypaint. Delivered! And if bits of paint peel off at altitude and get sucked into the engine, gluing themselves to the turbine blades until catastrophic failure of an engine, well, we can just patch the paint recipe in the next sprint! Paint that's "hot pink" is part of this sprint. The user story about engines that don't fail is part of the next sprint.

    The real problem with aircraft design is that all our little user stories are in a big clunky database. If we printed out the database's contents (by hand!) on little 3x5 index cards, then we'd be using the best practices of both Scrum and Kanban. Our planes would be so damn agile they'd have turning radii measured in inches.

    When a senior engineer piped up that an aircraft with a turning radius measured in inches would kill everyone on board due to G-forces measured in the thousands of Gs, and would likely tear itself apart because the centripetal force far exceeds the tensile modulus of steel, titanium, carbon fiber, or anything else available, he was terminated because "switching from traditional tube-construction to blended-wing-body design made of unobtanium" was part of the next epic.

  9. One loss of $500m is another's gain of $500m by Anonymous Coward · · Score: 5, Informative

    This isn't the equivalent of $500m of infrastructure burning down. The money was lost by some investors, but gained by other investors.

  10. Test People by stuffduff · · Score: 3, Interesting

    "Anyway, no drug, not even alcohol, causes the fundamental ills of society. If we're looking for the source of our troubles, we shouldn't test people for drugs, we should test them for stupidity, ignorance, greed and love of power." -- P. J. O'Rourke

    --
    "Can there be a Klein bottle that is an efficient and effective beer pitcher?"
  11. Re:And Save What? More Fantasy? by fuzzyfuzzyfungus · · Score: 4, Interesting

    The really troubling thing (to my mind) is not so much the 'what does Wall St. produce?' question(which, as you note, is ostensibly 'capital allocation'; but the 'how efficiently do they actually produce it?' question.

    In a non-pathological market situation, you would hope to see Wall St.'s share of the economy as a whole be static or declining(as newer technology makes allocating capital easier and less expensive) and the demand for 'capital allocation' exist only so far as other business sectors find that more efficient capital allocation makes them more efficient and productive(in the same way that you would want to see any other support function of a business kept in line with the business overall. You wouldn't want your IT group consuming a greater percentage of your total economic output every year). Trouble is, that isn't what the numbers reflect.

    Instead of acting as other suppliers do, and having their health and size depend on the success of the customers, the financial services sector has managed to capture a steadily increasing share of the value relative to other sectors. Absolute growth would be one thing, if the economy as a whole is growing; but relative growth, in terms of percentage of total output captured, suggests a substantial increase in the market(and regulatory) power of financial services without necessarily any increase in the value of their product to their customers. That is bad.

  12. Re:So, sue the developer for the cost he caused. by 140Mandak262Jamuna · · Score: 5, Insightful
    They will sue the unemployed coder for 400 million dollars. Some CXO will certify in good faith he hopes to collect the money. S&P will accept the certificate and rate the credit worthiness of the company AAA. Goldman Sachs will use S&P rating to sell the company to some poor smuck, your 401K mutual fund or my pension fund or our municipalities long term fund at 400 million over the true worth. Everyone involved in the racket will award themselves huge bonus, consultation fee and commissions. That is how 400 million dollars of profits are created, transferred to private individuals and the corresponding 400 million dollar loss for the counter parties are socialized. Either small investors, or government institutionalized investors, or straight forward government bail out. We are always the counterparties who are on the losing end of every such gigantic whoppers.

    America once had a great capitalism. Now we have the system where no matter what risk the rich insiders take, all the profits are theirs and all the losses are ours. A system where the ruling elites are protected from the consequences of their actions, where they can rig the game so that they win no matter what, is how societal collapse begins. Jared Diamond's book "Collapse" discusses specific case studies showing how it collapses. Greenland colonization from Iceland, Pueblo Indians, Easter Island were what he discusses in great detail.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  13. You cannot make competitions 'safe'. by Remus+Shepherd · · Score: 3, Insightful

    The purpose of avionics is to get a plane from one point to another without incident.

    The purpose of automated stock trading software is to make as much money as possible while screwing the other guy if you get the opportunity.

    You'll never make automated stock software 'safe'. Its purpose is inherently risky and combative. You're not up against the laws of physics and the occasional thunderstorm; you're up against other people who have similar software and an urge to hurt you. This is Wall Street PvP (that's Prick-versus-Prick). It's unsafe by its nature.

    You cannot make competitions entirely 'safe'. What you can do is pen them in so that they do not hurt bystanders. Just like putting crash walls around a NASCAR track, we need to put up regulations around Wall Street so their blood combat does not spill out and harm the larger economy. Re-implementing Glass-Steagall is the least that we can do to keep Wall Street's fiery crashes from hurting the common people. There are probably more reforms we could make to wall them off properly.

    --
    Genocide Man -- Life is funny. Death is funnier. Mass murder can be hilarious.
  14. Re:So, sue the developer for the cost he caused. by Dan+Dankleton · · Score: 3, Interesting

    Oh, for an "I wish it weren't true" moderation.

  15. Re:And Save What? More Fantasy? by dkleinsc · · Score: 4, Interesting

    This increase in the relative growth of the financial sector was one of the predictions in Karl Marx's Das Kapital: He saw bond markets and stock markets as the natural and predictable outgrowth of the role of a capitalist, which in his view was somebody who made their living not by producing stuff but by buying the means of production and making other people produce stuff. Bonds in particular simply abstract the concept completely away from any actual work: The capitalist now doesn't even do the buying and managing himself, but buys bonds allowing somebody else to do that work and demands a portion of the proceeds of the firm in return. As the capitalist class gains more and more wealth, the trade in bonds and other financial instruments goes up as a percentage of the economy, while the industrial and agricultural production becomes less important.

    (And no, I'm not arguing that workers of the world should unite and revolt, just that Marx was a serious economist who made some good points about how capitalism works.)

    --
    I am officially gone from /. Long live http://www.soylentnews.com/
  16. Outlaw High-frequency automated trading by iplayfast · · Score: 3, Insightful

    High-frequency automated trading are destroying the stockmarket. With transactions on a stock happening at thousands of times a second, when things go bad they go bad very quickly. When things go well, the normal trader gets reamed.

    IMHO High-frequency automated trading should be outlawed, stocks should be bought and sold at a rate comparable to human interaction. Say 1 per second. Then if things go bad, it goes bad over the course of a day and people can react. Brokers normally buy and sell bulk amounts of stock, so this would be no different.
    It would level the playing field, and put the normal investor at less of a disadvantage compared to the big companies. If a stock is particularly hot, then some trades won't get made by the end of the day. This is in other words reverting to the stock market of old, where the market could be looked at, and expected to stay the same over the course of a minute.