Now more than a month since the conflict began, the Iran war has been anything but predictable. Traffic through the Strait of Hormuz, a critical oil passage, has plummeted, sending oil prices surging. The conflict has spread to other countries in the Middle East, and just when it seems like the U.S. and Iran are on the precipice of an agreement that would end the war, matters seem to reescalate.
All this makes it unclear whether this conflict will end in a matter of weeks or be a more prolonged affair. While investors shouldn't try to predict when the war will end, they can build baskets of stocks that will hedge their downside if the conflict is prolonged, or jump higher on a near-term resolution.
Image source: Getty Images.
Three stocks to own if there is a prolonged conflict
Oil: Chevron
As of April 7, crude oil prices had surged to $113 a barrel. If the war lasts a long time, there's no reason oil couldn't reach $150 per barrel, or even $200 in an extreme scenario. The obvious thing to buy to prepare for rising prices is an oil stock like Chevron (CVX 1.51%). The stock has already ripped upward nearly 28% this year.

NYSE: CVX
Key Data Points
While Chevron's share price would likely decline if the war ends and oil prices come down, the company performs well with oil at $60 per barrel. Its balance sheet is strong, and operations have improved.
It's also likely to benefit from changing tides in Venezuela, following the removal of that country's president Nicolás Maduro. Chevron, which has existing operations in the country, previously said it could increase its production in Venezuela by 50% over the next 18 to 24 months.
The stock also has a strong dividend yield, recently 3.6%.
Fertilizer: iShares MSCI Agriculture Producers ETF
Issues in the Strait of Hormuz have also affected global fertilizer prices, as roughly 30% of the world's fertilizer trade passes through the strait daily. This has led to intense demand for fertilizer, and pushed prices -- and therefore, fertilizer stocks -- higher.
If the war persists, this could remain the case. One way to gain exposure to fertilizer is through the iShares MSCI Agriculture Producers ETF (VEGI +0.58%), which owns the stocks of major fertilizer producers and provides additional exposure across the agriculture sector. Fertilizer stocks have already enjoyed an incredible run, so I don't see the need to have direct exposure.
Defense: Lockheed Martin
Another stock that will likely do well the longer the war lasts is the defense company Lockheed Martin (LMT 1.05%), which makes a wide range of weapons and combat systems for the U.S. Army, Navy, Air Force, and Marines. Even if and when the Iran war winds down, Lockheed Martin will still be well-positioned.

NYSE: LMT
Key Data Points
Three stocks that should rebound fast if there is a quick end to the war
Higher oil prices can help some stocks during a prolonged conflict, but it also hurts a lot of stocks. But some businesses currently being hurt by high oil prices are also built to rebound quickly if oil prices return to more normal levels. If the Iran war ends relatively quickly, these stocks should recover quickly, too.
Airlines: United Airlines
The airlines sector tends to struggle when faced with higher jet-fuel costs. United Airlines (UAL 0.68%) stock is down more than 18% this year, largely on concerns about travel and fuel costs. Airlines have also struggled because of the partial shutdown of the U.S. Department of Homeland Security, which pays Transportation Security Administration (TSA) workers, leading to travel delays from a reduced TSA workforce.

NASDAQ: UAL
Key Data Points
Prior to the conflict, however, United's stock had hit an all-time high on earnings momentum. The quicker the war wraps up, the quicker oil prices will decline, and airlines will get back to business as usual.
Mortgages: Compass
Perhaps surprisingly, mortgage companies can be adversely affected by the Iran war. Mortgage rates had been declining prior to the war. They're now back on the rise over concerns about inflation triggers that higher oil prices are likely to exacerbate. The inflation rise is ending some of the momentum mortgage companies had finally found after a multiyear period of high mortgage rates and home prices.
Compass (COMP +5.26%) became the world's largest mortgage broker after its acquisition of Anywhere Real Estate. The company projected $300 million in synergies from the deal, and the ability to gain additional scale by offering brokers better technology and resources, giving it good momentum. Its stock is down more than 32% this year but an end to the conflict that eases inflation concerns could spark a rebound.
Technology: Microsoft
The geopolitical risk has also hurt some of the largest technology and artificial intelligence (AI) names in the market, including Microsoft (MSFT 1.13%), which just saw its stock have its worst quarter since 2008.
The stock price is down 21% this year. I share the market's concerns about AI, Microsoft's intense investments in AI infrastructure, and the lackluster performance of its AI digital assistant Copilot. Yet Microsoft is still one of the largest tech conglomerates in the world. While AI is now a big part of its strategy, Microsoft will still be a phenomenal company regardless of what happens with AI. A quicker end to the Iran war and improved market sentiment could get the stock back on track.





