By now, investors in offshore oil rig operators are used to being put through the wringer. Shares of major companies in the sector have been brutally hammered by the stock market over the past several years.

But all that changed in 2018. During the first nine months of the year, many offshore drillers' stocks popped by more than 30%. The slump was over and it would be smooth sailing from there on out.

Or would it? According to data provided by S&P Global Market Intelligence, all the major offshore rig stocks had a horrible October. Shares of Ensco (VAL) fell 15.4% for the month, Seadrill's (SDRL) shares were down 17.8%, Transocean's (RIG -2.29%) stock gave back 21.1%, and shares of Noble Corporation (NEBLQ) fared the worst, dropping an astonishing 28.6%.

Here's why October was more tricks than treats for these companies, and what investors should do now.

An offshore oil rig with its lights on in open water

The offshore drilling industry has underperformed the stock market over the last five years. October was no exception. Image source: Getty Images.

The price isn't right

When it comes to offshore oil rig operators, the price of oil rules. High oil prices make it more profitable to drill for oil offshore -- particularly in deep or ultradeep water, where drilling is more expensive and difficult. And when more companies are interested in offshore drilling, it increases demand for offshore rigs, which means rig operators can charge higher day rates, utilize more of their fleets, and make more money.

When oil prices are down, on the other hand, rig operators are often among the first to feel the pinch, and they feel it the hardest. While a drilling company can refocus its operations to cheaper onshore drilling opportunities, offshore rig operators don't have that luxury. Worse, it's the deepwater and ultradeepwater rigs that command the highest day rates...and are the first to be idled when oil prices drop.

During the oil price slump of 2014-2017, many rig operators' stocks lost most of their value as drilling companies abandoned offshore drilling left and right. A few didn't even survive: Atwood Oceanics was bought by Ensco at a bargain-basement price, and Seadrill went into bankruptcy protection, only emerging earlier this year. Those that did come through saw their stock prices drop by 80%...or more.

Calmer seas

Things seemed like they were turning the corner in late 2017, when crude oil prices started climbing. That climb continued throughout much of 2018. Both Brent crude (a benchmark for most international oil sales) and WTI crude (one for most domestic oil sales) hit three-year highs at the beginning of October. A barrel of Brent crude was trading for $85 per barrel, with WTI crude close behind at more than $75 per barrel.

Unfortunately, prices fell a bit in October. The spot price of Brent crude dropped 9.5% during the month, to $74.84 per barrel. WTI crude spot prices fared even worse, falling by 10.7% to close out the month at $65.31 per barrel. Those declines may seem pretty small, but you have to realize that they made October the worst month for oil prices in more than two years. That had investors wondering if the long oil price rally was starting to sputter, and they naturally took it out on oil rig operators.

Rig operators, though, weren't the only ones affected by oil-price declines. Many drillers saw their stocks fall during the month as well, and the big oilfield services companies also posted double-digit share price declines. As Cheech and Chong once observed, things are tough all over.

Small potatoes

In the grand scheme of things, though, this October drop barely registers for offshore rig operators. That's because the companies' shares have already tumbled so far over the last five years:

SDRL Chart

SDRL data by YCharts.

The spike in Seadrill's stock price came when it emerged from bankruptcy after a restructuring, so what looks like a price pop is actually a drop thanks to changes in the share count.

Basically, thanks to the comparatively long lead time to initiate an offshore drilling project versus an onshore drilling project -- and thanks to the many onshore opportunities available in places like the Permian Basin -- the offshore industry is still dealing with the fallout of the oil-price slump. But with U.S. onshore projects beginning to run into pipeline constraints, offshore opportunities are starting to look more attractive to drillers.

Indeed, there have been recent signs that the industry is waking up from its prolonged nap. Investors just need to hope it happens before cyclical oil prices start seriously trending downward.