Compared to commodities like gold and oil, bonds, bank certificates of deposit (CDs), and housing, no asset class has delivered a higher annualized long-term return than the stock market. But when examined over shorter time frames, the major indexes become far less predictable.

Over the trailing-two-year period, investors have watched the iconic Dow Jones Industrial Average (^DJI 0.40%), benchmark S&P 500 (^GSPC 1.02%), and growth-propelled Nasdaq Composite (^IXIC 2.02%), catapult to multiple record-closing highs, plunge into a bear market, and now bounce substantially from their respective 2022 bear market lows. For new and tenured investors alike, the question is the same: Where will stocks head next?

A shadowy silhouette of a bear superimposed onto a financial newspaper displaying stock quotes.

Image source: Getty Images.

Although there's no such thing as a foolproof indicator that will tell you the direction stocks will head with 100% accuracy over a lengthy period, there are market indicators and metrics that have an uncanny ability to forecast stock market moves. While these indicators are completely capable of being wrong, it's a rare occurrence.

One such indicator, which has a flawless track record of forecasting stock market moves since 1966, offers a big clue as to where stocks may head next.

This closely monitored indicator is sounding its loudest warning in decades

While there is no shortage of economic indicators and recessionary forecasting tools available, the most prominent tends to be the Federal Reserve Bank of New York's recession probability indicator.

The NY Fed utilizes the spread (difference in yield) between the three-month and 10-year U.S. Treasury bonds to determine how likely it is that a U.S. recession will happen within 12 months.

A normal yield curve slopes up and to the right. This is to say that shorter-dated bonds that mature in a few months, or perhaps a year, will have lower yields than bonds set to mature in 10 or 30 years. The longer your money is tied up in an interest-bearing asset, ideally, the more you should be compensated. An up-sloping yield curve is typically indicative of a healthy U.S. economy and/or a positive outlook on the economy by investors.

Conversely, an inversion of the Treasury bond yield curve signals concern about the U.S. economic outlook. During a yield-curve inversion, short-term Treasury bonds sport higher yields than longer-maturing notes. While there have been instances where yield-curve inversions haven't led to a U.S. recession, every recession following World War II has been preceded by a yield-curve inversion.

10 Year-3 Month Treasury Yield Spread Chart

10 Year-3 Month Treasury Yield Spread data by YCharts. Gray areas denote U.S. recessions.

With the three-month/10-year bond spread hitting its largest inversion in more than four decades recently, it's no surprise to see the NY Fed's recession probability tool screaming at the top of its lungs that an economic downturn is likely. As of the latest reading, the NY Fed's indicator calls for a 67.31% chance of a recession taking shape by or before June 2024. 

Keep in mind that the NY Fed's recession-forecasting tool has been wrong once before. In October 1966, there was a greater than 40% chance of a U.S. recession, yet one never materialized. But since October 1966, anytime this probability tool has surpassed 32%, we've witnessed a recession take place.

Historically, stocks perform quite poorly in the months following the official declaration of a recession by the eight-economist panel of the National Bureau of Economic Research. In other words, this indicator would imply that stocks are likely to move lower over the next 12 months.

Another leading indicator provides ominous clues for investors

However, the NY Federal Reserve's recession probability indicator isn't the only forecasting tool that offers an ominous warning to Wall Street and investors.

For decades, The Conference Board Leading Economic Index (LEI) has acted as a leading indicator of economic activity in the United States. The LEI has 10 inputs -- three financial components and seven nonfinancial components -- that are used to collectively anticipate turning points in the economic cycle. According to The Conference Board, the LEI's predictive variables tend to predict these "shifts" about seven months in advance.

For May 2023, the LEI declined by 4.3% over the six-month period between November 2022 and May 2023. This 4.3% drop is notable for two reasons.

To start with, it represents the 14th consecutive monthly decline for the LEI. That's the third-longest streak of monthly declines, when back-tested to 1959.

The other factor to note is the arbitrary line in the sand where, if crossed, a U.S. recession has occurred every single time. For the LEI, this figure is a decline of at least 4%. The LEI has fallen by more than 4% on a six-month basis and is nearing a double-digit drop on a year-over-year basis.  History is crystal clear that once the LEI reaches warning levels of this magnitude, a U.S. recession has eventually taken shape.

Not only have the Dow Jones, S&P 500, and Nasdaq Composite often endured the bulk of their losses after a recession is officially declared, but as Chief U.S. Strategist of the Ned Davis Research Group Ed Clissold pointed out in February, no bear market after World War II has ended prior to the declaration of a recession. 

There's no reason to be overly concerned about a recession if you're a patient investor

The NY Fed's recession probability indicator hasn't been wrong in 57 years, while the LEI hasn't been wrong, period, when back-tested to 1959. This offers a relatively convincing case that U.S. economic activity could demonstrably weaken at some point in the not-too-distant future. That's typically bad news for the job market, corporate earnings, and stocks in general.

But if you're a patient investor with a long-term mindset, recessions represent nothing more than the inevitable small waves in a big ocean.

A businessperson closely reading a financial newspaper.

Image source: Getty Images.

For instance, did you know that all 12 recessions following World War II have lasted only two to 18 months? By comparison, periods of economic expansion are almost always measured in multiple years. In fact, we've enjoyed a period of expansion that lasted longer than a decade. Being optimistic has unquestionably benefited investors over long periods.

To add to the above, there have been 39 double-digit percentage declines in the S&P 500 since the start of 1950. That works out to a double-digit decline, on average, every 1.88 years. Except for the 2022 bear market, every previous correction, crash, or bear market was eventually cleared away by a bull market.

If you need further proof that long-term optimism pays, look no further than my favorite research report presented by Crestmont Research. Crestmont analyzed what an investor would have generated in annualized total returns, including dividends, if they bought an S&P 500 tracking index and held it for 20 years. Back-testing to 1900 allowed Crestmont 104 rolling 20-year periods' worth of data (1919-2022).

The results couldn't have been clearer: Investors holding an S&P 500 tracking index for 20 years would have generated a positive total return 104 out of 104 times. Put another way, when you put your money into the stock market matters far, far less than how long you allow your money to work for you. So even if a recession is on its way, history shows that it pays to be optimistic and think long term.