Since the U.S. and Iran went to war in late February, the U.S. stock market has reacted the way it usually does when markets turn volatile. Some sectors jump, while others get crushed. Energy and defense stocks rallied as oil surged and governments started considering higher defense spending. Meanwhile, the technology and AI names that carried the market in 2025 came under pressure as investors began to question valuations.
The S&P 500 has been one of the most volatile indexes to trade. On some days, traders are focused on the war; on others, they shift back to interest rates and inflation. That has created a classic “buy the dip” and “sell the rally” environment. But if you watch the major indexes closely, they are actually telling you exactly what the market is worried about and what it wants.
Jaime Martinez Medina, Global Market Strategist at PU Prime commented:
Since the escalation in the Middle East, U.S. equities have shifted into a more volatile and rotational environment. Rather than moving in a single direction, markets are reacting to three dominant forces: geopolitical risk, oil prices, and expectations around Federal Reserve policy. This has created a pattern of sharp sector divergences, with capital rotating quickly between winners and laggards.
Energy has been the clearest beneficiary. With crude prices approaching the $100 level and risks surrounding the Strait of Hormuz still elevated, oil producers and service companies have outperformed. Higher prices translate directly into stronger earnings expectations, while increased drilling activity supports the broader energy supply chain. As long as oil remains elevated, the sector is likely to retain leadership.
Defense stocks have also attracted strong inflows. Rising geopolitical tensions typically lead to expectations of increased military spending, supporting companies exposed to defense and aerospace. This trend has reinforced the market’s shift toward more defensive and commodity-linked sectors in recent weeks.
In contrast, technology and AI-related stocks have faced pressure. After leading the market in 2025, elevated valuations and rising uncertainty triggered profit-taking and risk reduction. However, the underlying growth story remains intact. Investment in artificial intelligence and digital infrastructure continues, suggesting that the recent weakness is more cyclical than structural.
The next move for these sectors will depend heavily on monetary policy. A more accommodative Federal Reserve would likely support a rebound in growth and technology stocks, as lower yields increase the appeal of long-duration assets. Conversely, if inflation remains elevated and rates stay higher for longer, energy, financials, and commodity-linked sectors could continue to outperform.
A potential de-escalation in geopolitical tensions would also drive a sharp market rotation. Lower oil prices would ease inflation concerns and shift focus back toward growth, benefiting technology, consumer, and travel-related sectors.
For now, the market is clearly signaling one thing: oil remains the key variable, anchoring both inflation expectations and sector leadership in the current environment.
Daily S&P 500 Cash Index (SPX). Source: TradingView.
To absolutely nobody’s surprise, energy companies have been among the biggest winners since the war began. Oil prices have been pushing toward $100 a barrel, and the Strait of Hormuz is the reason why. That is probably the single biggest factor behind the strength in the energy sector. Rising oil prices generally mean stronger profits for the big producers. Two of the best-performing stocks in the sector are Exxon Mobil and Chevron.
Schlumberger and Halliburton have also been in high demand. These companies are expected to benefit because they provide the drilling equipment and engineering services producers need when they want to pump more oil. High crude prices usually mean more drilling, and that is good for both of them.
Defense contractors have also been another bright spot for investors. Companies like Lockheed Martin, Northrop Grumman and RTX build the fighter jets, missile systems, and military technology governments tend to rely on when tensions rise. Bigger defense budgets usually follow, and that is one reason defense stocks have outperformed much of the broader market since the war began.
If crude oil stays above $100 for an extended period, energy companies will likely remain among the strongest performers. Their earnings follow oil prices closely, and right now oil is not going down without a reason to.
May WTI Crude Oil Futures. Source: TradingView.
Oil service providers, pipeline companies, and shipping companies could also benefit. Producers are going to drill more when oil stays this high, and someone has to move it.
Expensive oil is a killer for airlines and trucking, though. Every dollar above $100 comes straight out of their margins.
While energy stocks climbed, a lot of technology and AI-related companies sold off during the early stages of the conflict. These were some of the market’s strongest performers coming into the war. Companies like NVIDIA, Microsoft and Palantir had big gains earlier in the year on the back of AI enthusiasm. When geopolitical tensions increased, investors started rotating money into energy and defense. Technology stocks got caught in the selling as investors reduced risk and locked in profits.
Daily NVIDIA. Source: TradingView.
Right now AI and software stocks are a mixed bag. Some are still sliding, while others look like they have found a floor. I still think the long-term demand story for AI is intact. Businesses are not going to stop investing in automation and machine learning just because there is a war.
Most analysts I follow think these stocks come back once things settle down. The revenue growth is still there. But how fast they recover is really a Fed story at this point.
If the Federal Reserve backs off and moves toward lower interest rates, growth stocks could get a significant lift. Companies like Apple, Amazon and NVIDIA tend to do well in an environment that features a dovish Fed and lower interest rates. Software firms and cloud computing companies would also benefit. A dovish Fed could support consumer spending and business investment, which helps e-commerce, online services, and digital infrastructure.
If the Fed keeps rates higher to fight inflation, the playbook flips. Growth stocks stay under pressure. Nobody pays high valuations when borrowing costs are elevated.
Energy holds up if oil does. Banks make more money when rates are high. Miners and commodity producers catch a bid if inflation keeps pushing raw material prices up.
If the war between the U.S. and Iran ended tomorrow, oil prices would likely drop sharply as supply disruption fears ease. I think the U.S. stock market would soar because of lower oil prices, but energy stocks would give back some of their recent gains.
Defense stocks would also be at risk as the case for increased military spending starts to fade. At the same time, investors would likely rotate back into economic growth sectors without the geopolitical tension to deal with.
Tech stocks, especially AI and cloud computing names, could bounce back fast once the war noise fades. Airlines, travel companies, and consumer businesses would also get a lift from lower fuel costs and a market that is focused on growth again.
The way I see it, three forces are driving this market right now: the war, oil prices, and Fed policy. Energy and defense have clearly been the strongest performers since February 28. AI and software stocks took a hit, but the long-term story is still intact.
If oil stays above $100, energy leads. If the Fed moves toward cuts, tech comes back. And if the war ends sooner than expected, the market will rotate fast toward the sectors that were leading before the bombs started falling. Keep your eye on crude oil. It is the pin holding everything together right now.
Right now I am leaning toward the prolonged-war scenario, and that means energy stays in the lead longer than most people expect.
James Hyerczyk is a U.S. based seasoned technical analyst and educator with over 40 years of experience in market analysis and trading, specializing in chart patterns and price movement. He is the author of two books on technical analysis and has a background in both futures and stock markets.