Computer-driven trading puts stock exchanges at risk

Computer-driven trading puts stock exchanges at risk

Summary: Here's a scary thought for you. Every day, hundreds of billions of dollars of financial transactions are driven completely autonomously by computer algorithms. The fate of corporations and nations rests on bits of computer code sent out by their makers to do battle in a high-stakes trading war. And when something goes wrong, it can go spectacularly wrong.

TOPICS: Hardware, CXO

Here's a scary thought for you. Every day, hundreds of billions of dollars of financial transactions are driven completely autonomously by computer algorithms. The fate of corporations and nations rests on bits of computer code sent out by their makers to do battle in a high-stakes trading war. And when something goes wrong, it can go spectacularly wrong.

When you think of stock exchanges you probably have a quaint notion of a paper-strewn room full of stressed-out traders yelling to be heard over each other while watching big screen monitors that cover every square inch of the walls. Or maybe you have a more modern picture of an army of white collar workers barricaded in their caves of steel intently staring at computer displays, waiting to pounce on the right news or slightest movement by executing a quick buy or sell order.

In reality, today's markets are largely driven not by bellicose bombasts or educated elites but by algorithms written by programmers like you and me. Programs that are set free to wreak profit (or havoc) in the innards of the world's electronic cyber-market. According to the Financial Times, program trading accounts for about 30% of the total daily activity on the New York Stock Exchange, and a whopping 60-70% of the activity on other markets such as the Nasdaq. In 2008, the total world derivatives market was estimated at nearly $800 *trillion* dollars.

Unsatisfied by the decision speeds of mere humans, huge banks have turned over the keys to the vault to programs to do the trading of stocks and derivatives for them. The idea has a certain appeal: Put in a few billion dollars, push a button, and walk away while the computer does all the work. When you come back, if all goes well, you've made a nice profit. "Leave the driving to us," as the slogan goes. Even a monkey could do it. Right?

Well, if you're not a developer and you're reading this, please take heed. Computers make mistakes, because they just do what their programs tell them to do, and all programs have mistakes lurking in them. "Bugs," we call them. Much of the craft of computer programming is concerned with reducing the number of bugs. When a program controls something really important, like say an X-Ray machine, a fighter jet, a space craft, or a nuclear power plant, extreme efforts are put into eliminating as many bugs as humanly possible. But as a number of high profile cases have proven, it's impossible to detect them all.

Take the case of the NYSE Euronext exchange operator. Recently it fined a trading firm for "failing to control" its trading algorithm. One day, out of the blue, the program decided to send "hundreds of thousands" of messages for faulty orders, clogging up the exchange for everyone for hours. All it takes is a bad "if" statement or a misplaced semicolon, or maybe an array that grows larger than expected or a race condition in multi-threaded code. Let's not even mention what a malicious hacker with an agenda can do.

So what's the fix? Acknowledge that bugs happen, and put in checks and balances to catch and contain them. Don't assume computers are infallible. They're just as fallible as the humans that build and program them. More, because humans have the advantage of common sense. Let's use it.

Photo credit: Walt Dabney

Topics: Hardware, CXO

Ed Burnette

About Ed Burnette

Ed Burnette is a software industry veteran with more than 25 years of experience as a programmer, author, and speaker. He has written numerous technical articles and books, most recently "Hello, Android: Introducing Google's Mobile Development Platform" from the Pragmatic Programmers.

Kick off your day with ZDNet's daily email newsletter. It's the freshest tech news and opinion, served hot. Get it.


Log in or register to join the discussion
  • Am I crazy..

    Funny, I thought a stock market was for investing in companies, expecting good leadership and improvements in products to create profit for the shareholders.

    Does the current financial environment even resemble an investment? You own a stock for milliseconds, and trade it again, and magically you have more money than before.

    No thought or research into the employees or the company's long term success. Just make a buck and get out. Do we really wonder why this country is in the shape it is?
    • SEC is useless

      You're the sane one.

      Meanwhile SEC is looking for public comments on this same issue, because they're clueless.

      Wow... SEC is getting billions of taxpayer dollars and want us to do their job!!!
    • You're not crazy

      It's lottery feaver to a new level. People that make piles of money for taking advantage of systemic issues (arbitrage they call it) or those that convince us to buy their overpriced stock so they can get rich for doing nothing. On the backend, there are completely sustainable companies that are driven out of business by stock holders who demand an unsustainable growth rate (thanks sub-prime). Then these same greedy people blame all their problems on a low interest rate set by Greenspan. They're to lazy or entitled to do hosest work so they demand to enslave the public with high interest rates for their mortgages.

      It's a sad state of affairs....
      • Not Crazy, but Something Needs to be Done About It!

        Controling arbitrage will be more than a full time job. But arbitrage in some form (computer, manual) has been going on for as long as the stock market has been around. Its arguable that the demise of Lehman and Merrill-Lynch was largly caused by a type of copmuter related arbitrage.

        And, just for the record...Greenspan hasn't been the head of the Fed since 2006. Ben Bernanke is now; though some would say that the Fed leadership still has his ear.
  • Ignorant idea!

    by ignorant.
  • I happen to be one of those programmers:

    In addition to being an IT proffessional, I also write programs for trading forex, futures, and stocks in my spart time. You don't neccessarily have to write a whole software package from scratch either; There's a number of charting software packages, such and Ninja Trader, Trade Station, or Neoticker, that lets you write scripts to impliment your trading strategy and even interface through an API to your online broker, such as Interactive Brokers, MB Trading, and Interbank FX.

    Yes, it can be done...but I can tell you from my own experience, coming up with an algorithm that consistantly makes more profits than loses is not easy. In fact, we trading programmers have a name for such a winning program; We call it "The Holy Grail". That should tell you everything you need to know about how difficult it is.

    Before unleashing your program on your real money account, you need to back test it on historical price data, and forward test it on a real-time, demo account. Back testing doesn't always yeild usefull results unless you have tick-by-tick data for the period you wish to test it over. They only way you can really know how your script will perform is the forward test in demo.

    As for the example sighted that clogged up the the Euronext, that program probably wasn't adequately tested before being unleashed on a real account

    If you look on the Internet, you will find quite a number of vendors who are selling script packages for use with some of the charting packages mentioned above or as stand-alone programs. they will charge anywhere from $99 to $5000 for their systems. Sounds pretty easy to just by a trading system and let run and make money for you, doesn't it? Well I have some bad news for you: The vast majority of these trading systems for sale DO NOT WORK!!! In fact, the reason way they're being sold by their makers, is that they didn't make any money for their creators on the market, so the only way they can make money from it, is to sell it to those who are too lazy to learn programming and write on themselves.

    The reality is that, when a programmer comes up with a "Holy Grail", the last thing he's going to do is sell it or give it away. Afterall, if you own a goose that lays golden eggs, are you going to sell it? HELL NO!!! The reason why they won't part with it is; if everybody starts to use the same effective trading method on the market, it will cease to make profits anymore. That's why they're so jealously guarded.

    I hope this provides you with some insight.

    Yam Digger
    Yam Digger
  • The real problem isn't code bugs

    A much more dangerous problem, and orders of magnitude harder to predict or detect, is coupling between the algorithms that the trading houses are empolying in their automated systems. Imagine a race condition developing between, say, Goldman Sachs' and UBS' platforms such that they produce a positive feedback loop and drive the market wildly in one direction or the other.

    What if the core risk assumption constants in the programs are similar and very wrong? The mortgage market meltdown comes to mind here.

    The problem is not bugs in a single trading platform; it's the possibility of dynamic interference developing between all of them. Of course, this is no different than a generally held belief among human traders. But the speed at which the condition can develop and impact the market within automated trading platforms makes the potential impact much higher.
  • RE: Computer-driven trading puts stock exchanges at risk

    I talked with one of my friends that is an <a href="">online Forex broker</a> and he told me that autonomous algorithms are not the safe way to make a profit. You should use your own brain. The computer is just a tool.