Last year, the S&P 500, which is a stock index that tracks the 500 largest publicly traded companies in the U.S., declined 19%. This was the index's worst performance since 2008, a period that was characterized by the Great Recession that followed the subprime mortgage bust. 

It's been a different story in 2023, though. Investors seem to be much more optimistic. As of July 14, the S&P 500 is up 17%. This might prompt some to want to ride the momentum in the hopes of generating strong returns in their portfolios. 

But is it safe to invest in the S&P 500 right now? Let's take a closer look. 

An open laptop displaying a chart while one hand holds a paper displaying charts and tables and two hands point to the paper using pens.

Image source: Getty Images.

A new year brings new optimism 

With the Federal Reserve aggressively hiking interest rates to stop soaring inflation throughout 2022, it was a terrible year for investors. This tighter monetary stance came after interest rates were kept low and stimulative measures were taken to boost the economy during the pandemic. Investors clearly didn't like the rate increases, and the stock market's performance proved it. 

However, things have bounced back nicely this year. Reports show that inflation has been cooling for several months now. And investors might take this as a sign that the central bank will pause rate hikes or even start to cut interest rates in the near future. 

Plus, some of the largest businesses out there, particularly in the tech sector, have produced solid financial results that have propelled their share prices in 2023. 

And even though the economy looks to be on solid footing, some analysts are still worried that a recession will happen. It's hard to predict when or if this might occur, but it's certainly something on investors' minds. 

Don't time the market 

Now that investors have a better understanding of recent trends in the market and the economy, perhaps it's a good idea to try and understand the S&P 500's valuation. A popular metric to gauge this is called the cyclically adjusted price-to-earnings ratio, otherwise known as the CAPE ratio. This measures the S&P 500's current level relative to the average of the past 10 years' earnings (adjusted for inflation). It's meant to smooth out any fluctuations with net income. 

Based on the S&P 500's current CAPE ratio of 30.8, it seems as though the market is fairly valued right now. That's because the average CAPE ratio over the past decade is 29.3. And over the past five years, the CAPE multiple averaged 31.4. Investors might be tempted to time the market and wait for a better entry point, but data show that any effort to pick the right moment to invest is a losing proposition. 

For what it's worth, I think it's always a good idea for investors to put money to work in the market, and more specifically, the S&P 500. Over long periods of time, the stock market generally increases in value. The S&P 500, with dividends reinvested, has averaged an annual return of roughly 10%. That means your money would double about every seven years. That's not too shabby for a passive investment vehicle. 

Follow this course of action 

There are numerous index funds out there that track the S&P 500, like the Vanguard 500 Index Fund Admiral Shares or the Fidelity 500 Index Fund. Their fees are low, and they are managed by reputable firms that have long operating histories, which should ease any worries that investors might have. 

And as I noted above, because it's almost impossible to time the market correctly, I think the best thing investors can do is to dollar-cost average into one of these index funds on a monthly or quarterly basis. This ensures that you can take advantage of multiple price points, eliminating the need to waste time on trying to predict when the market will bottom out. 

This makes an investment in the S&P 500 always a good idea. For investors who truly care about the long term, it doesn't get any simpler than that.