It's been a good year for the stock market -- or has it? By the numbers, things look great. The S&P 500 is up 13%, which is an above-average return even for a full year.

However, like so many things right now, it doesn't feel like all is well. Perhaps that's because of high inflation, rising interest rates, or fear of an impending recession.

But whatever the cause, many investors are wondering: Is it safe to invest in the stock market right now? Let's have a closer look and find out.

Person looking at computer screen and wondering.

Image source: Getty Images.

How it's going

Since the S&P 500 hit a recent low in October 2022, the benchmark index is up almost 21%. At its peak this summer, the index was up 30% from last October.

So without a doubt, the stock market has bounced back this year. Yet for many investors the rally still hasn't taken their portfolio values back to the levels seen in 2021. 

And if you pull back and look at the S&P 500's return over the last three years, it's easy to see why. The index remains about 8% off its all-time high, which was achieved around New Year's 2022.

SPY Total Return Level Chart

SPY Total Return Level data by YCharts

What's more, several financial factors are making the average American feel worse off economically. 

First, inflation remains a problem. The U.S. Consumer Price Index (CPI), a measure of year-over-year price changes, remains well above the Fed's target rate of 2%. In addition, last month's CPI rose to 3.67%, showing that the Fed's rate hikes haven't stopped inflation in its tracks.

Second, interest rates are skyrocketing. Some 30-year mortgage rates are nearing 8%. These are the highest rates in 20 years, making home ownership near-impossible for many prospective buyers. Moreover, high interest rates stretch budgets as vehicle loans and other forms of consumer credit become more expensive.

All this puts a damper on investor sentiment, no matter what the S&P 500's total return for the year might be.

Where we could be headed

In addition to the negative sentiment, there are valid reasons to think the stock market might see another correction soon. The Federal Reserve's interest rate hikes have brought short-term interest rates to their highest levels in more than a decade. That has led to an inversion of the yield curve

While it sounds intimidating to understand, a yield curve inversion is a simple concept. It is when savers are paid a higher yield for shorter-duration loans rather than longer ones, for example when 1-year certificates of deposit yield a higher savings rate than a 30-year US Treasury bond. This is unusual; typically, savers are paid an increasingly large premium the longer the loan.

In the chart below, you can see a yield curve inversion using the Fed Funds Effective rate and a 30-year U.S. Treasury yield. The shaded areas represent U.S. recessions (which typically correspond to stock market corrections).

Effective Federal Funds Rate Chart

Effective Federal Funds Rate data by YCharts

Also note that inversions seem to occur (the purple line moves above the yellow line) about 9-18 months before a recession (and stock market correction) begins.

In short, the warning signs are there that we may be headed for another recession. 

What to do

All that said, it's not all doom and gloom. Far from it. Remember, study after study shows that timing the stock market is a fool's errand. It's much better to buy and hold, letting the volatility come and go all while keeping your cool.

Well-run companies with solid business models will come through any potential recession just fine. The best course of action is to do your research, invest in those stocks, and hold them (or better yet, add to them) through periods of high volatility. 

It's the best way to ensure long-term success. And it's always safe to do.