By Teresa Rivas

Oil had its best dollar gain in more than four years, on news that OPEC agreed to a supply cut.

Getty Images

Not surprisingly, the energy sector responded well to the deal, with the S&P 500 Energy Sector was up 4.8%. That was the largest one-day percentage gain since last August, and the index closed at its highest level since July 2015.

As for individual stocks, ConocoPhillips (COP), Newfield Exploration (NFX), Hess (HES), and Anadarko Petroleum (APC) had their best one day percentage gains since 2008.

In related news, Tortoise Capital believes that U.S. producers should benefit if OPEC sticks to its agreement, and Treasury yields also rose on the deal.

The Energy Select Sector SPDR ETF (XLE) ended up more than 5% in recent trading, while the United States Oil Fund (USO) gained 8.6%.