Human beings can, and still do, send orders from their computers to the matching engines, but this accounts for less than half of all US share trading. The remainder is algorithmic: it results from share-trading computer programs. Some of these programs are used by big institutions such as mutual funds, pension funds and insurance companies, or by brokers acting on their behalf. The drawback of being big is that when you try to buy or sell a large block of shares, the order typically can’t be executed straightaway (if it’s a large order to buy, for example, it will usually exceed the number of sell orders in the matching engine that are close to the current market price), and if traders spot a large order that has been only partly executed they will change their own orders and their price quotes in order to exploit the knowledge. The result is what market participants call ‘slippage’: prices rise as you try to buy, and fall as you try to sell.
In an attempt to get around this problem, big institutions often use ‘execution algorithms’, which take large orders, break them up into smaller slices, and choose the size of those slices and the times at which they send them to the market in such a way as to minimise slippage. For example, ‘volume participation’ algorithms calculate the number of a company’s shares bought and sold in a given period – the previous minute, say – and then send in a slice of the institution’s overall order whose size is proportional to that number, the rationale being that there will be less slippage when markets are busy than when they are quiet. The most common execution algorithm, known as a volume-weighted average price or VWAP algorithm (it’s pronounced ‘veewap’), does its slicing in a slightly different way, using statistical data on the volumes of shares that have traded in the equivalent time periods on previous days. The clock-time periodicities found by Hasbrouck and Saar almost certainly result from the way VWAPs and other execution algorithms chop up time into intervals of fixed length.
The goal of execution algorithms is to avoid losing money while trading. The other major classes of algorithm are designed to make money by trading, and it is their operation that gives rise to the spasms found by Hasbrouck and Saar. ‘Electronic market-making’ algorithms replicate what human market makers have always tried to do – continuously post a price at which they will sell a corporation’s shares and a lower price at which they will buy them, in the hope of earning the ‘spread’ between the two prices – but they revise prices as market conditions change far faster than any human being can. Their doing so is almost certainly the main component of the flood of orders and cancellations that follows even minor changes in supply and demand.
‘Statistical arbitrage’ algorithms search for transient disturbances in price patterns from which to profit. For example, the price of a corporation’s shares often seems to fluctuate around a relatively slow-moving average. A big order to buy will cause a short-term increase in price, and a sell order will lead to a temporary fall. Some statistical arbitrage algorithms simply calculate a moving average price; they buy if prices are more than a certain amount below it and sell if they are above it, thus betting on prices reverting to the average. More complicated algorithms search for disturbances in price patterns involving more than one company’s shares. One example of such a pattern, explained to me by a former statistical arbitrageur, involved the shares of Southwest Airlines, Delta and ExxonMobil. A rise in the price of oil would benefit Exxon’s shares and hurt Delta’s, while having little effect on Southwest’s (because market participants knew that, unlike Delta, Southwest entered into hedging trades to offset its exposure to changes in the price of oil). In consequence, there was normally what was in effect a rough equation among relative changes in the three corporations’ stock prices: Delta + ExxonMobil = Southwest Airlines. If that equation temporarily broke down, statistical arbitrageurs would dive in and bet (usually successfully) on its reasserting itself.
No one in the markets contests the legitimacy of electronic market making or statistical arbitrage. Far more controversial are algorithms that effectively prey on other algorithms. Some algorithms, for example, can detect the electronic signature of a big VWAP, a process called ‘algo-sniffing’. This can earn its owner substantial sums: if the VWAP is programmed to buy a particular corporation’s shares, the algo-sniffing program will buy those shares faster than the VWAP, then sell them to it at a profit. Algo-sniffing often makes users of VWAPs and other execution algorithms furious: they condemn it as unfair, and there is a growing business in adding ‘anti-gaming’ features to execution algorithms to make it harder to detect and exploit them. However, a New York broker I spoke to last October defended algo-sniffing: