The above button links to Coinbase. Yahoo Finance is not a broker-dealer or investment adviser and does not offer securities or cryptocurrencies for sale or facilitate trading. Coinbase pays us for certain activity generated through this link. Prices displayed are informational.

Given the pressure that higher energy prices and the Middle East conflict are putting on the global economy, it makes sense to think President Donald Trump and Iranian leaders might find a way out of the crisis relatively soon.

In this scenario, oil prices WBS00 CL00 BRN00 would drop quickly, and so would energy stocks NYE.ID.

It's almost impossible to sell a condo unit these days: 'I feel trapped'

Stocks face a growing list of threats โ€” so why are investors staying so calm?

I have $125,000 in credit-card debt. Will $17,000 a month in income, including disability, affect my bankruptcy?

90% of retirees are making this miscalculation with their savings

As Warren Buffett's reign ends, fans should sell Berkshire โ€” and buy these stocks instead

There's one problem with this positive outlook: Energy-sector insiders aren't buying it. Instead, they are buying their stocks โ€” suggesting they think the stocks go higher from here, not lower.

In the past few months as oil prices and energy stocks climbed, insiders at over 35 energy companies have put around $55 million into their stocks.

Some of the bigger examples since late May include the U.S. energy producers Matador Resources MTDR, where insiders including the CEO and CFO have purchased over $1.5 million in stock, and Vitesse Energy VTS, where a director bought $1.6 million in shares. The CEO at the refiner HF Sinclair DINO bought shares worth $1.3 million in mid-August.

True, the insider buying has happened at smaller energy companies, not at giants like Chevron CVX or ExxonMobil XOM. But that doesn't mean the insiders know the sector any less. In my experience, stretching over two decades, of tracking insiders, sectorwide buying like this โ€” even at smaller companies โ€” is a bullish signal.

What explains the insider buying at a time when energy prices and stocks might soon retreat hard? I recently spoke with some energy-company insiders and sector analysts to find out. Following are three reasons for the disconnect.

Energy-sector veteran Rob Thummel, who helps managed the Tortoise Energy Fund TNGY, thinks the war with Iran will end after the U.S.'s midterm elections. But the new price floor for West Texas Intermediate crude, or WTI, will be $75, or around $10 above where it traded prewar. That's because traders will price in geopolitical risk again, and countries have to rebuild oil inventories, Thummel told me in a recent interview.

"I don't know if 'back to normal' will happen any time soon. Everybody has been saying that for a while, but it just hasn't happened yet," he said. The International Energy Agency recently pushed its timeline for normalized Middle East energy flows into 2027 from late 2026 previously.

Energy companies can make decent returns on capital with oil at $75, according to Thummel, and this helps explain insider buying.

Near term, energy prices could even go much higher, and insiders might be making this bet. WTI could trade up to $120 or $130 as the war drags on, said Ben Cook, who manages the Hennessy Midstream Fund HMSIX. "This is not a situation that looks like it is de-escalating in any way. Given that both sides are dug in and Trump wants Iran denuclearized, it is unlikely we are going to see any peace agreement soon," Cook told me in a recent interview. Oil hit $120 and $130 in the early stages of the Russia-Ukraine war. A repeat would send gasoline up to $5 a gallon or higher.

Don't miss: Record diesel prices are exposing pain points in the stock market and economy

Also see: Strategist observes that gasoline prices today imply a crude-oil price of $150, compared with current futures levels between $100 and $110

Natural gas NG00 prices in Europe and Asia are especially high. Natural gas recently traded for around $27 per million British thermal units (MMBtu) in those regions, compared with just under $3 in the U.S. There's an investing angle here. This will continue to benefit companies that source natural gas in the U.S. to sell it in Europe and Asia, noted Thummel. He singled out Cheniere Energy LNG and Venture Global VG.

"There is a new understanding that there are permanently going to be concerns about the security of energy because so much of it comes out of the Middle East," says energy-sector expert and value investor Bob Robotti of Robotti & Co. Advisors, whose value equity strategy has outperformed the S&P 500 SPX by 20.3 percentage points this year through the end of August. "International offshore oil is where energy security is going to be, on a worldwide basis," Robotti told me in a recent interview.

This is one reason Robotti owns Subsea 7 SA SUBCY, which helps energy companies develop offshore production. Robotti is of the view that Subsea 7 SA might get bought out, possibly by the offshore-drilling contractor Noble NE.

"Energy companies understand there are going to have to be multiple sources of supply outside the Middle East," agreed Kurt Hallead, the treasurer and head of investor relations at Tetra Technologies TTI, where a director and officer were recently buying stock.

The company sells chemicals used in energy production called completion fluids, mainly to deepwater producers in the North Sea and off the coast of Brazil and the U.S.

Since the start of the war, drilling contracts at these companies have picked up. "The war has accelerated those projects," Hallead told me in an interview. This should help Tetra meet its goal of roughly doubling revenue in the next four years compared with September 2025.

The new emphasis on energy security also favors Canadian oil and gas companies, said Robotti.

"Today, given energy-security issues, the rest of the world is saying, 'Canada is a stable place โ€” how do I get in?' " he said. Earlier this month, for example, Shell SHEL closed on a deal to buy the Canadian oil and gas producer ARC Resources, its biggest purchase in a decade. Robotti owns the producer Tourmaline Oil CA:TOU, one of Canada's largest natural-gas producers, in which insiders have been buying stock. "But if you close your eyes and pick one of them, you will do well," he quipped.

"The relative winner in all this is the midstream space in the U.S.," said Cook at the Hennessy Midstream Fund. "The world will continue to look at the U.S. as reasonably safe supply." Here, he singled out Expand Energy EXE, where the CEO and CFO bought around $540,000 in stock in May and June, and Williams Cos. WMB.

Besides the names mentioned above, other U.S. energy producers, services and pipeline companies with particularly strong insider buying include Energy Transfer ET, Mammoth Energy Services TUSK, Infinity Natural Resources INR, Northern Oil and Gas NOG, Solaris Energy Infrastructure SEI and Alpha Metallurgical Resources AMR in coal.

Smaller energy companies trade at steep discounts to tech and other parts of the market, noted Ben Messier, the director of investor relations and business development at Vitesse Energy, which owns stakes in U.S. energy projects in the North Dakota, Colorado and Wyoming. They typically have low enterprise-value-to-Ebitda multiples of four or five, and high free-cash-flow yields of 10% to 15%. This could explain the insider buying.

"We remain overweight the group and believe investors should consider adding positions even with $100-a-barrel oil prices," William Blair energy sector analyst Neal Dingmann wrote in recent research note, citing the same double-digit free-cash-flow yields.

One reason the shares of so-called smid-cap energy stocks that insiders are buying look cheap is that they have failed to keep up with oil prices, Messier told me in a recent interview. Since the start of the Iran war on Feb. 28, the State Street SPDR S&P Oil & Gas Exploration and Production exchange traded fund XOP is up 30% compared with a 55% advance for WTI.

'My main goal is to help people': I'm single, 74, with $10 million burning a hole in my pocket. What should I do?

'My total balance should be $20 million': I invested $1.1 million in a crypto platform. Have I lost it all?

'I'm burned out': I'm constantly helping my cousin who is running out of money. Is it too much to expect his sister to help?

I'm in my 50s. My mother died from Alzheimer's. Do I need long-term-care insurance?