In what order are stock trades executed?

ByABC News
October 24, 2011, 8:54 PM

— -- Q: When an investor places a trade, how is it decided what order will it be executed? Do some investors get their trades completed first?

A: When you're in line at the deli counter for some sliced ham, the rules are simple: Take a number.

First come, first served is the standard benchmark of fairness when there's a queue for a service. And Wall Street, more or less, works the same way.

The inner workings of the markets are extremely complicated. There are many markets operating at the same time and separate pools of trading. The markets are so complicated, it took months for the regulators with all their power to analyze the events of the Flash Crash of 2010 and, even then, the findings were scant.

But, the basic rules for stock trading are very clear. Orders to the stock exchanges are to be handled on a so-called "price time" basis, says Joseph Saluzzi, trader at Themis Trading who studies the inner working of the markets.

When orders come in clumps, computers instantaneously process them to find those with the best prices. In other words, offers to sell at the lowest prices are filled first, giving buyers the access to the best prices. If many trades come in, all offering the best price, the next priority is given to the trades that were received first, Saluzzi says.

And forget about the old-fashioned idea of your human broker getting on the phone, or even yelling out orders on a trading floor. All this matching of orders is done by computers, which dispatch orders to all the available marketplaces. Regulation requires that a broker get the best available price for clients. And the whole process takes less than a second.

So using the deli counter example, investors are not only given a number but asked what price they're looking to buy or sell at. Those with the best prices are served first, in the order they came to the counter.

With that said, there are certainly opportunities for trading desks to use their speed to get an edge. Some traders are located physically closer to the exchanges so their orders get inputted faster. And there are some cases where bids and offers are made and quickly yanked. Computerized stock trading can create opportunities for troubles.

Matt Krantz is a financial markets reporter at USA TODAY and author of Investing Online for Dummies and Fundamental Analysis for Dummies. He answers a different reader question every weekday in his Ask Matt column at money.usatoday.com. To submit a question, e-mail Matt at mkrantz@usatoday.com. Follow Matt on Twitter at: twitter.com/mattkrantz