By John McCrank

NEW YORK (Reuters) - The U.S. stock market is rigged in favour of high-speed electronic trading firms, which use their advantages to extract billions from investors, according to Michael Lewis, author of a new book on the topic, "Flash Boys: A Wall Street Revolt."

High-frequency trading (HFT) is a practice carried out by many banks and proprietary trading firms using sophisticated computer programs to send gobs of orders into the market, executing a small portion of them when opportunities arise to capitalize on price imbalances, or to make markets. HFT makes up more than half of all U.S. trading volume.

The trading methods and technology that make HFT possible are all legal, and the stock exchanges HFT firms trade on are highly regulated. But Lewis said these firms are using their speed advantage to profit at the expense of other market participants to the tune of tens of billions of dollars.

"They are able to identify your desire to buy shares in Microsoft and buy them in front of you and sell them back to you at a higher price," Lewis, whose book is available on Monday, said on the television program "60 Minutes" on Sunday.

"This speed advantage that the faster traders have is milliseconds, some of it is fractions of milliseconds," said Lewis, whose books include "The Big Short" and "Moneyball."

Those milliseconds can be valuable, making it possible to send around 10,000 orders in the blink of an eye.

Darting in and out of trades, HFT firms make just fractions of a penny per trade, but the sheer speed and volume of their trading activity allows those that are successful to make significant profits.

Proponents of HFT argue that the presence of such firms makes it easier for all market participants to find buyers and sellers for their trades, and that the speed at which HFT firms can detect and take advantage of pricing imbalances between different markets and assets leads to smaller bid-ask spreads.

But Brad Katsuyama, former head trader in New York for the Royal Bank of Canada and a major figure in Lewis's book, said he was finding that when he would send a large stock order to the market, it would only be partially filled, and then he would have to pay a higher price for the rest of the order.

Story continues

With the help of new hire Ronan Ryan, Katsuyama realized that his orders travelled along fibre optic lines and hit the closest exchange first, where high frequency traders would get a glimpse, and then use their speed advantage to beat him to the other 12 U.S. public exchanges and 45 private trading venues. HFT algorithms could then buy the shares Katsuyama wanted, and then sell them to him at a slightly higher price.

Katsuyama and Ryan created a system in which RBC would send its orders first to the exchange that was the furthest away, and last to the exchange that was closest, with the goal of arriving at all places nearly simultaneously, cutting out HFT.

"Essentially, our fill rates went to 100 percent. We couldn't believe it when we actually figured it out," Katsuyama told "60 Minutes."

Katsuyama said he decided to start a new trading platform, called IEX, for the Investors' Exchange, employing similar tactics to those he used at RBC.

"It almost felt like a sense of obligation to say we found a problem that is affecting millions and millions of people - people are blindly losing money they didn't even know they were entitled to. It's a hole in the bottom of the bucket," he said.

IEX has attracted the investment of David Einhorn, the billionaire owner of hedge fund Greenlight Capital, and an endorsement from Goldman Sachs. The investors in IEX are fund companies and individuals, not banks.

"We are selling trust, we are selling transparency, and to think that trust is actually a differentiator in a service business, is actually a crazy thought, right?" said Katsuyama.

Earlier this month, New York state's Attorney General Eric Schneiderman said he believes U.S. stock exchanges and other platforms provide HFT firms with unfair advantages.

Exchanges allow trading firms to place computer servers inside the exchange's data centres so that the firms can see the data as soon as possible. The practice, called co-location, is regulated and available to anyone who wants to pay for it.

Schneiderman has begun meeting with the U.S. exchanges, which include IntercontinentalExchange Group's New York Stock Exchange, Nasdaq OMX Group's main bourse, and four platforms run by BATS Global Markets, on possible reforms, a source close to the situation told Reuters.

A ban on HFT is unlikely, as U.S. regulators would be loath to put policies in place that could lead to a less liquid market, Robert Greifeld, chief executive officer of Nasdaq, said on Thursday.

(Reporting by John McCrank; Editing by Diane Craft)