"There are substantial rewards for adopting a regular routine of investing and following it no matter what, and additional rewards for buying more shares when most investors are scared into selling."-Peter Lynch

The streak is over. For the first time in more than 24 months, the S&P 500 has closed at a record high.

Yet, while much of Wall Street is in party mode, some investors may still feel down in the dumps -- and with cause. That's because while the formal bear market has ended, many portfolios took a serious hit over the last two years. Indeed, some investors might feel that a new all-time high is no time to buy stocks -- it's time to sell them. So, what's an investor to do?

My advice to investors: Ignore the noise. Instead, let's explore what's happened in the market, how some stocks remain in bear market territory, and what investors should be focused on in 2024.

Time to get started.

Stock chart on a computer screen.

Image source: Getty Images.

The S&P 500 just ended its longest all-time high drought since 2012.

If the stock market still feels under the weather to you, it might be because 2023 was the first time in over a decade that the S&P 500 failed to reach a new all-time high. Consider the chart below:

^SPX Chart

^SPX data by YCharts

The yellow line represents an all-time high in the S&P 500. Note that when the line moves horizontally, no new all-time highs are being made (such as the six years between late 2007 and 2013). Conversely, when the line moves swiftly upwards, many new all-times are being made (such as in 2021).

As you can tell, the market just ended its most prolonged dry spell of all-time highs since the Great Financial Crisis.

That means that 2023 was the first calendar year since 2012 that the S&P 500 did not make a new all-time high.

What does it mean for investors?

While all-time highs might seem like a technical indicator of little value to investors, it's important to remember that they represent something much more tangible: Many stocks plummeted from their 2021 highs -- and many have struggled to recover.

Take PayPal Holdings for example. Shares of the fintech company have fallen 80% from the stock's all-time high, set in 2021. Worse yet, they continue to trend lower; shares of PayPal are down 17% over the last six months.

Even some stocks that enjoyed bounce-back years in 2023 remain well off their 2021 highs. Consider Tesla -- between November 2021 and January 2023, Tesla shares lost more than 73% of their value. And while they've rallied impressively since then (shares more than doubled in 2023) the stock remains more than 48% below its all-time high.

PYPL Chart

PYPL data by YCharts

In short, many investors are discouraged when reviewing their portfolio statements -- especially if they did a lot of buying in 2021.

What should investors do about it in 2024?

In short, follow Peter Lynch's advice: Keep on investing.

Here's one trick that could help: Say you're bullish on Tesla but discouraged that your shares have declined in value since you bought them at their peak in 2021. By thinking of the current price as a discount or a sale, you may find it easier to double down on your investment. Every share bought today will cost roughly half of what it did in 2021. Better still, buying shares at today's prices will lower your cost basis -- in effect, your purchase price. By dollar-cost averaging, you can set a schedule to accumulate shares over the course of several weeks, months, or years.

That, in a nutshell, is following Lynch's advice about "adopting a regular routine of investing and following it no matter what."

Now, perhaps you're no longer bullish on Tesla or PayPal -- and maybe you never were. In that case, take another piece of advice from Lynch and find a company whose products you like and enjoy, do some research, and if you like what you see, start investing there. Because there's almost never a wrong time to invest in a great company.

Furthermore, as study after study has shown, trying to time the market doesn't work. What does work is regular investing -- rain or shine, bull market or bear market.

So, to sum up, 2024 has seen the birth of a new bull market -- which is something to celebrate. But investors shouldn't let that change their overall investment strategy. Rather, it's time to stick to a "regular routine of investing and [follow] it no matter what." Because that's a winning strategy in any market.