EU legislators have clinched a deal to toughen the bloc’s financial market rule book, backing sweeping measures that will put the brakes on high-frequency trading and curb speculation in commodity derivatives.

The overhaul, which will push more activity on to regulated platforms, is designed to remedy deficiencies laid bare in the 2008 financial crisis. The accord ends more than two years of haggling over proposals from EU financial services chief Michel Barnier.

“These new rules will improve the way capital markets function to the benefit of the real economy,” he said after agreement was reached on Tuesday. “They are a key step towards establishing a safer, more open and more responsible financial system and restoring investor confidence.”

The EU’s bid to revamp its market legislation, known as the Markets in Financial Instruments Directive (Mifid), is a centrepiece of the bloc’s work to implement agreements reached by the Group of 20 nations in the wake of the turmoil that followed the 2008 collapse of Lehman Brothers. Members of the European Parliament and officials from Greece, which holds the rotating presidency of the EU, resolved outstanding differences on the law over more than seven hours of negotiations.

The accord must still be formally approved by the assembly and national governments. The law will take effect two-and-a-half years after it is published, with longer transitions for some rules.

“Mifid will dramatically reshape the way firms operating in the financial services sector conduct their business,” Ed Parker, the head of derivatives at law firm Mayer Brown, said. For the over-the-counter derivatives market, “there will be a seismic shift resulting in higher costs, tighter margins and reduced flexibility when hedging”.

Key issues in the final meeting included to what extent the law should cover energy derivatives and what investor protection rules should be included.

Under the deal, some derivatives in the electricity and gas markets will be exempted from Mifid rules as they are covered by other EU legislation. The accord also grants a temporary waiver for some coal and oil derivatives from requirements that trades go through clearing houses.

The rules for commodity derivatives included an “effective system” of position limits that would “curb speculation and help decrease price volatility and inflation”, Arlene McCarthy, a UK legislator in the parliament’s Socialist group, said. “High and volatile food prices have a devastating impact” on poorer countries, she noted. – Jim Brunsden from Bloomberg