Much of the nation has been focusing on the computer difficulties surrounding the nightmarish implementation of the Affordable Care Act, or ObamaCare.

But what if just such a glitch in computer trading caused a $461 million loss and nearly sank a prestigious firm?

That very thing happened late last year in the Knight Capital debacle.

And experts are saying that there’s virtually nothing to keep it from happening again. And worse. Much worse.

“Can it happen again? My God, it already has,” says Bill Singer, a veteran securities attorney, who noted Goldman Sachs had its own computerized trading problems with former programmer, Sergey Aleynikov, accused of stealing code from the bank.

In the words of the Securities and Exchange Commission, on Aug. 1, 2012, “Knight Capital traded more than 397 million shares, acquired several billion dollars in unwanted positions and eventually suffered a loss of more than $460 million.” As a result, Knight sold itself to GetCo and has been fined $12 million by the SEC.

Knight, regulators said, deployed the wrong code in a trading router. As a result, New York Stock Exchange systems were disrupted for some 45 minutes.

Nevertheless, several securities-industry observers say neither regulators nor Wall Street has learned anything from the disaster, and there is still insufficient testing of electronic trading systems.

“It is an ongoing problem because we continue to roll out systems without adequate beta testing,” added Singer, pointing to — yes — the ObamaCare woes.

Singer and others warned that the August 2012 Knight trading disruption will happen again at another firm.

“It absolutely can. Most trading today is driven by machine,” according to Larry Tabb, founder of the Tabb Group, an industry consultancy. “And to the extent that programming is done by people, and given the complexity of the market structure, there will be problems that people don’t expect.”

The problem, Tabb added, is the actual trading, or what is called execution, is earning firms very little, so they don’t have the best systems.

One option might be a mandated kill switch, which would automatically limit how much damage could be done by trading systems.

But the ultimate solution that would prevent a repeat “Knightmare” — and others before and since — will not come from regulators, says Singer. He says it must come from the industry, with all firms chipping in to construct a backup trading system.

Whatever the solution turns out to be, all agree the need is dire.

“Few if any brokers,” Tabb noted, “have the capital to withstand a Knightmare scenario.”