BATS glitch is latest to highlight the complexity of the markets NEW YORK (Reuters) - The complexity of modern markets means there are bound to be more events such as the systems error that led to hundreds of thousands of trades being executed improperly on BATS Global Markets over the past four years, the head of the No. 3 U.S. equities exchange said on Thursday. A coding problem led to over 440,000 transactions being executed at prices that were not the best available, in violation of U.S. Securities and Exchange Commission rules. The SEC's enforcement and trading and markets divisions are investigating the issue, said a person with knowledge of the matter. The person, who was not authorized to speak with the media, added that BATS' self-reporting of the problem would likely work in the exchange's favor. It is possible that other such problems could be found as the exchange proactively seeks them out, Joe Ratterman, chief executive of BATS, said in an interview. "There is going to be, between real-time dynamic systems, extreme edge case scenarios where things don't happen as you would expect," he said. The trades in question made up 0.003 percent of the around 12.1 billion trades on BATS options and equities markets over the past four years and were executed within the expected range of outcomes of both the exchange and its customers, making the problem very difficult to discover, he added. On Friday, in a routine self-audit of BATS' data, an operations person found an execution that looked improper and, after further research, noticed a pattern. The error has been occurring since BATS became an exchange in 2008 and cost BATS' customers a total of $420,361. "This is merely the latest in a series of technological foul-ups and demands regulatory attention, and a game plan to deal with getting a better handle on assessing technology and how markets are functioning," former SEC Chairman Harvey Pitt told Reuters. High profile glitches in the past year include the attempted market debut of Lenexa, Kansas-based BATS in March, when a software error caused the company to take the extremely rare step of withdrawing its initial public offering of shares. Technology errors also led to the botched Facebook Inc IPO on Nasdaq OMX in May and the trading error that nearly sank Knight Capital Markets in August. The SEC routinely reviews such matters with the exchanges, said spokesman John Nester. In 2011, the agency sanctioned No. 4 U.S. equities exchange Direct Edge for weak internal controls that led to millions of dollars in trading losses and a systems outage. Last year, NYSE Euronext paid $5 million to settle charges it gave certain customers "an improper head start" on trading information due to software issues and compliance failures. In an interview on Wednesday with Reuters, outgoing SEC enforcement director Robert Khuzami said there is still much unfinished business for the enforcement division in the area of market structure. "The new area that obviously is of concern has to do with platform trading and market abuse issues around high-frequency trading, algorithmic trading, market structure participants," he said. We need more and better transparency into what is going on so we can determine to extent to which there are abuses that are occurring. As the complexity of automated trading systems has increased, it has become very difficult to effectively debug their code, said Larry Harris, professor of finance and business economics at the Marshall School of Business, University of Southern California. The vast number of exchange order types, together with a long list of complicated regulatory rules, makes it is nearly impossible to test for all possible scenarios, he said. "Dependence on computers is no defense for failures of business systems," he added. Ratterman, a founding employee of BATS, who has led the company since June 2007, said that taking a "cynical view" of the soundness of the markets is not a bad thing, as it holds the market players to account. "Because it is a real-time, dynamic system, we will continue to go in with the attitude that it is our job to find stuff, not that it is our job to prove that nothing is broken," he said. Ratterman said BATS is working with is customers on the issue of compensation and will discuss it with the SEC. In all, 119 firms were impacted, although 74 of them would have a claim of less than $100 over the four years, he said. BATS' U.S. equity market share on Thursday was 12.42 percent, up from its month-to-date average of 11.87 percent. Reporting By John McCrank.; Additional reporting by Sarah N. Lynch and Andre Grenon