In April of 2020, when futures contracts for West Texas Intermediate (WTI) crude oil briefly traded for minus $37, the thought of an energy crisis like the ones in the 1970s or 2008 seemed unimaginable. Now, there's chronic pain at the pump as a gallon of gasoline exceeds $5 throughout much of the U.S.

With pain comes opportunities, though -- or so it would seem if you're bullish on oil and, therefore, on the drillers that get it out of the ground. As President Biden declares that ExxonMobil (XOM 1.15%) "made more money than God this year," investors might wonder whether it's a good time to add some petroleum producers to their portfolios.

It's a fair question, albeit not an easy one to answer. The bull and bear camps both have compelling arguments. And surprisingly enough, your final decision could depend less on the oil-price trajectory than on time-tested valuation metrics.

Supply side worries

Russia's invasion of Ukraine has sent fossil-fuel prices on an upward spiral. More precisely, though, it's America's ban of Russian oil imports that put WTI traders on edge in April. Two months later, the import ban is still in place -- a stark contrast to 2021, when the U.S. "imported nearly 700,000 barrels per day of crude oil and refined petroleum products from Russia," according to the Biden administration.

The U.S. produces much of its own petroleum, but the domestic market isn't isolated from extrinsic shocks. Global petroleum production has been crimped by geopolitical events as Russia reduced its output by nearly 1 million barrels per day in April, according to IEA estimates, thereby reducing the world's oil supply by 710,000 barrels per day. Middle East OPEC+ members may step up to the plate to help fill the gap, though, as IEA expects non-Russian global oil output to rise 3.1 million barrels per day during the May-through-December period. Near-term, though, the supply outlook is dim as OPEC's oil output declined 176,000 barrels per day in May. So far, then, the oil-price bulls seem to have the advantage as supply side concerns could linger for a while.

A reliable cure

After months of commodities traders obsessing over supply side issues, the WTI price tumbled 5.5% on June 17, reminding Wall Street that demand is just as important -- and that oil prices can be stunningly volatile. As the petroleum bears came out of hibernation and WTI dropped to $110, the discussion suddenly shifted from production to consumption (or the lack thereof).

With that, an adage came to the fore: The cure for high prices is, indeed, high prices. Yet, demand-related concerns aren't entirely based on the idea that people will travel less because gas prices are elevated. That's a factor, no doubt, but an unexpected factor has entered into the broader crude-market picture in mid-2022: the U.S. Federal Reserve.

History shows that what really cures high oil prices is the ultimate agent of demand destruction: a recession. As the Fed is in its first tightening cycle in recent memory, there's no shortage of experts predicting an economic slowdown. If higher interest rates curtail growth, and that in turn curtails consumption, then this could prove to be a double whammy as oil stocks don't typically rise on slow economic growth and reduced gasoline usage. Since the U.S. is the largest oil consumer, a decline in U.S. consumption in a recession would have an outsized impact on global demand -- but again, the oil price will move on global supply and-demand dynamics more than on the U.S. alone.

A crude but effective metric

So if the supply side favors the bulls and the demand side favors the bears, should investors buy oil stocks now? The answer is yes, a moderate allocation is fine because reasonably valued businesses have all-season appeal.

Instead of trying to predict the next twist or turn of the oil price, investors can channel value-investing expert Benjamin Graham's spirit and apply old-school weighing-machine principles. Using trailing-12-month price-to-earnings ratios makes it easy to narrow the field and focus on companies whose share prices are justified by the earnings.

Two examples include ExxonMobil (with a P/E ratio of 14.28) and Chevron (CVX 1.54%) (P/E of 13.94). ExxonMobil's balance sheet seems solid enough as the company's Q1 2022 cash increased by $4.3 billion sequentially and its cash flow from
operations "more than funded capital investment, additional debt reduction, and shareholder distributions in the
quarter." Chevron, meanwhile, nearly doubled its cash flow from operations year over year in Q1 2022 to $8.1 billion, and also roughly doubled the company's cash and cash equivalents to $11.67 billion. In other words, ExxonMobil and Chevron are two well-capitalized industry giants that may be better positioned than smaller drillers to withstand near-term oil-price volatility. Plus, as an added bonus for income-focused investors, these two companies pay quarterly dividends.

Ultimately, buying oil companies today can make sense if your time horizon is long enough to allow the market's weighing machine to favor value-enhanced businesses. That way, zigzag oil price moves won't shake you out of the trade as solid companies can outlast temporary supply and-demand anxiety.