If it’s not one thing, it’s another. And this time it was the targeted killing of an Iranian general that caused the stock market to finish the week in the red.

It didn’t start off that way. With a big rally on Jan. 2, the market looked like it would start off the New Year with a bang. But then news started circulating that the U.S. had killed Iranian general Qassem Soleimani, and all those gains quickly disappeared. The Dow Jones Industrial Average declined 10.38 points, or 0.04%, to 28,634.88 this past week, while the S&P 500 fell 0.2% to 3234.85. The tech-heavy Nasdaq Composite rose 0.2% to 9020.77.

Investors are right to fret about what’s happening in the Middle East. Iran will almost certainly respond to the assassination of Gen. Soleimani, and that response will add more uncertainty to an already chaotic situation. Oil prices rose more than 3% on Friday, adding to crude’s risk premium, while gold rose 2.3% to $1549.20 and the yield on the 10-year Treasury note fell 0.093 percentage point to 1.787%, as investors sought out safety.

And rightfully so. While a full-blown war is unlikely—and probably runs counter to the interests of both sides—Iran likely wants to respond in a way that rouses the patriotism of its citizens but doesn’t lead to a traditional conflagration, writes Deutsche Bank strategist Alan Ruskin. That means disrupting oil supply in the Persian Gulf and elsewhere. “The markets now look like they are about correctly priced (only) as an initial response to the strike on Soleimani,” Ruskin explains.

Even before the attack, the stock market looked like an accident waiting to happen. The S&P 500 had gained 8.5% during the last two months of 2019, and it began 2020 right where it had left off. And with the index trading at 18.2 times forward earnings, there was little cushion for investors in case something went wrong. “If it weren’t this, it would be something else that caused the pullback,” Dave Donabedian, chief investment officer at CIBC Private Wealth Management, told Barron’s. “A little bit of a breather here is a healthy thing.”

There were warning signs. Sundial Capital Research President Jason Goepfert notes that the options speculation index—a measure of whether options traders are betting on a rising or falling market—showed traders favored bullish strategies by 30% more than bearish ones. That index, Goepfert notes, was at the same level in 2000, before the internet bubble burst, and has risen to that level 14 times since then. The S&P 500 is often weak after such an occurrence: The index was lower two weeks later 40% of the time, with a median decline of 1.1%. One year later, the index was lower 58% of the time, with a median decline of 4.5%.

“While returns since 2010 were better than during 2000 (of course), they still weren’t great, with a tendency to see shorter-term gains evaporate during subsequent pullbacks,” Goepfert writes. “We’d consider this a warning.”

Another possible red flag: Breadth was not good this past Thursday, despite the S&P 500’s 0.8% gain. Apple (ticker: AAPL), Microsoft (MSFT), Amazon.com (AMZN), Facebook (FB), and Alphabet (GOOGL), which make up nearly 17% of the S&P 500, were up more than twice as much as the overall index.

As a result, the equal-weighted S&P 500 rose just 0.3% on Thursday, marking its worst day relative to the market-weighted version since 2017, noted Jonathan Krinsky, chief market technician at Bay Crest Partners. “That in and of itself is not bearish for the overall market, as long as the leaders continue to perform,” he writes.

That’s may be a lot to ask.

Write to Ben Levisohn at Ben.Levisohn@barrons.com