NEW YORK (Reuters) - A big high-frequency trading firm faces possible civil charges by regulators after its computer ran amok and sparked a frenzied $1 surge in oil prices in February, according to documents obtained by Reuters and sources familiar with the continuing investigation.

Infinium Capital Management confirmed only that it is the company at the center of a six-month probe by CME Group Inc into why its brand new trading program malfunctioned and racked up a million-dollar loss in about a second, just before markets closed on February 3.

The glitch explains for the first time the lightning-quick oil-trading surge of that day -- and it may have been a catalyst for the abrupt and largely unexplained $5 slide amid record volumes the following two days.

The firm’s buying frenzy also reveals how faulty computer codes, known as algorithms, can spark sharp volatility and send electronic markets spinning all in the blink of an eye.

Futures exchange operator CME Group is looking into the incident, which occurred at the New York Mercantile Exchange and highlights some of the same electronic-trading concerns raised by May’s “flash crash” in the U.S. stock market.

Exchange compliance officials met last month with Infinium’s management, and separately with engineers and developers who quit or were fired following the mishap, according to two sources.

The U.S. Commodity Futures Trading Commission is also looking at what went wrong, said one of the sources, who were not authorized to speak to the press.

The regulator or CME Group could charge the firm with “conduct detrimental” to the NYMEX, or with smaller offenses, the source said. A manipulation charge is a remote possibility, the source added.

Sweeping financial reform that became law last month gives the CFTC far more muscle to crack down on manipulative trading. However it is unclear whether this case involves such trading, and unlikely that the regulator could use its new enforcement powers retroactively.

In an interview, Infinium CEO and co-founder Charles Whitman said it was a “routine investigation” into an incident that “was a result of both human and computer error.”

The investigation also comes as the CFTC reviews the impact and risks of high-frequency trading in commodities, made all the more urgent by the flash crash in which markets broke down in a matter of minutes on May 6.

THOUSANDS OF ORDERS PER SECOND

Infinium, a household name in Chicago’s burgeoning trading community, relies on computer horsepower and quantitative models to earn razor-thin profits from short-term trading. It uses its own money to make markets and capitalize on tiny imbalances, a common high-frequency strategy.

The documents, dated March, reveal that Infinium used an algorithm that was less than a day old to execute a “lead/lag” strategy between an exchange-traded fund called United States Oil Fund, which tracks oil prices, and the U.S. crude benchmark future, West Texas Intermediate.

The algorithm was turned on at 2:26:28 p.m. (Eastern) on February 3, less than four minutes before NYMEX closed floor trading and settled oil prices. It immediately started uncontrollably buying oil futures, according to the documents, which include letters from Infinium’s lawyer to the regulation unit of CME Group, and cite notes from a company developer.

Infinium placed 2,000 to 3,000 orders per second before its flooded order router “choked” and was “dead in the water” a few seconds later, the developer’s notes said. The algorithm was shut down five seconds after it was turned on.

By then, the documents show, the firm had sent 4,612 “buy limit” orders into the market. It quickly offset the position, mostly with large “block” trades in the next few minutes, leaving it with a $1.03-million loss.

Infinium’s burst of buying and selling represented about 4 percent of average daily trading volume in the contract, and caused a brief 1.3 percent jump in oil prices, from $76.60 to $77.60, before settling at $76.98, Reuters data show. Trading volume spiked nearly eight-fold in less than a minute -- and the reverberations turned some heads.

The next day, February 4, commodities traders struggled to explain a 5 percent plunge in oil prices, the biggest one-day drop in half a year. On February 5, crude fell further, to $71 a barrel, and volume touched a then-record high.

Some people fingered London hedge fund BlueGold Capital Management for selling long positions -- a charge it promptly denied -- while others pointed to the unusual end-of-day market action the day before.

Stephen Schork, who runs market analysis company The Schork Group, told Reuters at the time the volume jump “reeks of someone making a mistake or (who) was in trouble and is in more trouble today.” CME Group said February 4 it was looking into the matter.

Infinium’s Whitman told Reuters the firm immediately alerted the exchange to the problem. “The parties associated with this error are no longer with the firm,” he said, adding the firm since adjusted its software “to ensure this error would not be repeated.”

CFTC and CME Group spokesmen both declined to comment on the Infinium probe.

“The ironic and sad part of the broken algo story is that the traders identifying patterns in the market unfortunately don’t use their expertise to identify abnormal patterns in their own trading,” said Larry Harris, a market structure expert and professor of finance and business economics at University of Southern California’s Marshall School of Business.

“The failure to have simple counters to identify potential problems with the algo, such as having thousands of buy orders in a row, is extremely troubling.”

ALGOS GONE WILD

Stock market regulators last year started pounding the drums on high-frequency trading, which is estimated to be involved in more than half of all cash equities and commodities trading volume.

While the U.S. Securities and Exchange Commission, under some political pressure, has led the charge in peeling back layers of the complicated marketplace, the CFTC this year followed suit with a new technology panel that aims to sniff out unfair advantages or systemic risks associated with high-frequency trading.

Whitman is a high-profile member of this panel. With 250 employees and offices in New York and London, Infinium is among the heavyweights in a group of proprietary firms called the Principal Traders Group, which formed this year to promote the benefits of electronic trading.

Meanwhile, Commissioner Bart Chilton told Reuters late last month he is “itching” to use the CFTC’s new authorities, under the Dodd-Frank Act, to fight trading practices that disrupt oil prices.

Under the new bill, the CFTC needs only to show that a trader acted in a manner that had the potential to disrupt markets to prove a manipulation case.

The documents did not suggest that Infinium was suspected of what is known as “banging the close” -- an illegal practice in which traders try to move the futures market by flooding it with orders just before it closes.

Infinium said its primary failure on February 3 was allowing thousands of orders per side per contract, instead of limiting it to the planned one, according to the documents citing the developer’s notes. The notes also indicate Infinium’s computer may not have properly recorded that it was sending orders.

The firm has answered several questions related to the mishap and now awaits a response from the exchange or the regulator.

The CFTC has been mostly unsuccessful in prosecuting manipulation cases over the last few decades. It has had better success with other types of enforcement cases, which often result in a settlement in which the accused firm accepts a fine but admits no wrongdoing in exchange for avoiding court.

(Reporting by Jonathan Spicer; additional reporting by Roberta Rampton

in Washington; Editing by Marguerita Choy)