EVERY computer-user knows the feeling of dread when a brand new piece of software causes the entire system to crash. Shareholders in Knight Capital, an American equity broker, now realise how expensive such glitches can be. On August 1st Knight Capital started to use a new software programme to execute its trades. Within an hour the programme had caused turmoil in the market, sending errant buy-and-sell orders that cost Knight $440m. Shares in the company plunged on the day and, by August 6th, shareholders were forced to accept a rescue that heavily diluted their stakes (see article).

Most trades these days are conducted by computer and are completed without fuss. As in other fields, technology has reduced costs, in particular the spread between the bid and offer prices. If lower trading costs encourage more investors to own shares, then the cost of capital for companies will fall, which is good news for the whole economy.

But there are drawbacks. The Knight glitch was just the latest in a series of cock-ups that have been linked to computerised trading. The most serious of these was the “flash crash” of May 2010, when the Dow Jones Industrial Average plunged 1,000 points within minutes and shares in Accenture, a consultancy, were briefly marked down to a preposterous one cent. Such events make investors fearful of trusting their nest-eggs to the stockmarket; Knight was the biggest handler of trades by small investors. The cost of capital could go up, not down.

Then there is the systemic risk. This time round, it was only Knight Capital that failed; what if it had been a much larger firm? The crisis of 2008 casts a long shadow. Not only did it show that financial companies can quickly implode, but the subsequent government rescues were highly unpopular with voters. Politicians might hesitate before bailing out another big financial firm, especially if the cause was reckless trading.

This newspaper seldom finds itself on the side of restraining either technology or markets. But in this case there is a doubt whether the returns justify the risk. Society needs a stockmarket to allocate capital efficiently, rewarding the best companies with higher share prices. But high-frequency traders are not making decisions based on a company’s future prospects; they are seeking to profit from tiny changes in price. They might as well be trading baseball cards. The liquidity benefits of such trading are all very well, but that liquidity can evaporate at times of stress. And although high-frequency trading may make markets less volatile in normal times, it may add to the turbulence at the worst possible moment.

Trade in haste, repent at leisure

So what is to be done? The world is not going back to the days of face-to-face trading with prices written on whiteboards by hand (a system that was controlled by a cosy cartel of dealers). But the Securities and Exchange Commission is right to suggest that automated programmes should be fully tested before they are used in live trading, and that voluntary guidelines on automated trading should be mandatory.

The regulators could go further. In October 1987 Wall Street suffered Black Monday, when the Dow Jones Industrial Average fell 23% in a day. An early form of programmed trading, called portfolio insurance, was to blame. In the aftermath “circuit breakers” were introduced, allowing trading to be halted when the market suffered a big fall. The same rules could be applied when the market seems excessively volatile, or when volume spikes exponentially. The most successful investor in history, Warren Buffett, says his ideal holding period for shares is for ever. So it surely will not do much harm to investors if, on occasion, they have to wait a second or two before dealing.

Update: This animated chart from Nanex shows the rise of high-frequency trading from 2007 to 2012.