What happened

Crude prices rallied this week on the growing anticipation that OPEC would extend its production reduction agreement through the end of 2018. That should help drain off more of the market's excess inventory, which should at least put a floor under oil prices. For the week, the U.S. oil benchmark, WTI, rose about 3% to more than $53 a barrel, finishing at the highest level in six months, while the global oil benchmark, Brent, increased nearly 4% and topped $60 a barrel for the first time in more than two years.

That said, while oil had a good week, the focus of investors was on third-quarter earnings. Several oil and gas stocks reported results this week, many of which drove big swings in their stock prices. The biggest, according to data from S&P Global Market Intelligence, came from Whiting Petroleum (NYSE:WLL), Oceaneering International (NYSE:OII) and Helix Energy Solutions (NYSE:HLX).

A drilling rig at sunset.

Image source: Getty Images.

So what

Whiting Petroleum was the lone gainer of this trio, popping 13% this week after posting expectation-beating third-quarter results. While the shale driller reported a loss of $50.1 million, or $0.14 per share, that was $0.06 per share better than analysts anticipated. Several factors drove that result, including a stunning 78% increase in production from its acreage in Colorado's Niobrara Shale and a 12% improvement in the price it realized for selling its oil. Meanwhile, the company noted that it's on pace to meet its full-year production growth target, including boosting output 10% in the fourth quarter.

Oceaneering International, on the other hand, plunged 24% this week after reporting its third-quarter results and unveiling its outlook for 2018. While the offshore product and service company's third-quarter results weren't terrible, its $0.02 per share adjusted loss did miss expectations by $0.01 per share. That said, the fuel for this week's sell-off was its dismal outlook. CEO Rod Larson said in the press release that the company believes its "2018 earnings will be significantly lower than 2017." Further, Oceaneering only expects to generate enough cash flow to make its debt payments and fund capital expenses, which led analysts to believe that the company would likely suspend its dividend.

Meanwhile, Helix Energy Solutions also plunged this week, falling nearly 11% after releasing its third-quarter results. That report wasn't too bad since earnings of $0.02 per share were in line with expectations. Instead, what tripped up the offshore service company were comments by CEO Owen Kratz on the accompanying conference call. He said the company had completed its strategic review and drew the conclusion that it should focus on strengthening its balance sheet and operations. That was a letdown for traders who bid the stock up a few weeks earlier after The Wall Street Journal reported that Helix had hired bankers to help it with a potential sale. It appears like no would-be buyers stepped up to the table, which isn't too surprising considering the dim outlook for the offshore drilling market.

Now what

The moves made by these three stocks correlates with what's going on in the oil market. Thanks to the high returns drillers can earn from onshore shale plays, Whiting and its peers are growing again even though oil remains relatively low. Offshore-focused companies like Oceaneering and Helix, on the other hand, are still having a tough time because crude isn't high enough to make offshore drilling as profitable as shale drilling. Because of that, it doesn't make sense to buy this week's dip in either offshore-focused stock since each could have further to fall if oil doesn't keep going higher.

Matthew DiLallo has no position in any of the stocks mentioned. The Motley Fool recommends Oceaneering International. The Motley Fool has a disclosure policy.