Flying home to New Jersey from Chicago after the first two days at his new job, Sergey Aleynikov was prepared for the usual inconveniences: a bumpy ride, a late arrival.

He was not expecting Special Agent Michael G. McSwain of the F.B.I.

At 9:20 p.m. on July 3, Mr. McSwain arrested Mr. Aleynikov, 39, at Newark Liberty Airport, accusing him of stealing software code from Goldman Sachs, his old employer. At a bail hearing three days later, a federal prosecutor asked that Mr. Aleynikov be held without bond because the code could be used to “unfairly manipulate” stock prices.

This case is still in its earliest stages, and some lawyers question whether Mr. Aleynikov should be prosecuted criminally, or whether a civil suit may be more appropriate. But the charges, along with civil cases in Chicago and New York involving other Wall Street firms, offer a glimpse into the turbulent world of ultrafast computerized stock trading.

Little understood outside the securities industry, the business has suddenly become one of the most competitive and controversial on Wall Street. At its heart are computer programs that take years to develop and are treated as closely guarded secrets.