Roy Sullivan was enjoying a quiet Saturday morning of trout fishing when the lightning bolt struck. It hit him on the top of his head and exited his lower body, causing burns down his chest and abdomen. Stunned by the strike but still alive, Sullivan was returning to his car when a black bear charged out of the woods and tried to steal his string of freshly-caught fish.

This was the seventh documented occasion that Roy Sullivan had been struck by lightning.

If you wanted to imagine a similar string of bad luck in the world of investing, you might think of a person who only puts money into the market a few days a year, and by some stroke of extraordinarily bad fortune, each of those days happens to be when the market has reached a new all-time high.

After all, there’s only one direction you can go from a peak.

This is, in fact, one of reasons some investors choose to use “dollar cost averaging” when investing large sums. This method divides a larger sum into smaller increments to invest into the market over a period of time, with the hope of minimizing the risk that you chose to put it all in on the “worst” possible day.

But is a new market high the “worst” possible day if your investing time horizon is several years or even decades?

Advisor and financial writer Ben Carlson wondered how much it would cost someone to experience this perceived bad luck. He asked: What would happen to your returns if you invested only on the market’s peak days?

What he discovered runs contrary to conventional wisdom.

First, Carlson looked at the frequency of new all-time high days. He defined these as days when the S&P 500 reached a value that superseded its previous high. For example, he determined that from 1988 through 2020 there had been more than 600 all-time highs, about 7.3% of all trading days.

Next, he compared returns for buying the index over time versus buying only on the peak days. The results are surprising. According to his calculations, a person who invested only on peak days would have had slightly better returns than a person who spread out their purchases over all days.

“All-time highs tend to beget all-time highs,” he says, “simply because that’s the way the markets work in a raging bull.”

Carlson doesn’t recommend trying to target all-time highs specifically as an investing strategy. There’s no way to predict when new peak days will occur. Rather, he points to it as a demonstration that investing at all-time highs doesn’t have to be a losing proposition.

Of course, the past performance of the market is no indicator of how it will perform in the future. And historically, there have been some long periods between successive all-time highs. But the evidence suggests that new highs can be as temporary as whatever recent low you’re measuring.

Investing for the long haul means following the evidence rather than your instincts. So, a prudent investor will take a broadly diversified approach with the close support of a trusted financial advisor.