The stock market is coming off nothing short of an historic year. In no particular order, Wall Street and investors navigated their way through:

  • The benchmark S&P 500 (SNPINDEX:^GSPC) losing over a third of its value in less than five weeks during the first quarter.
  • A record-breaking snap-back rally from the March 23 bottom that allowed the S&P 500 to hit an all-time high in under five months.
  • A brief, but steep, negative print on West Texas Intermediate crude oil futures in April; and
  • Historic volatility that took the CBOE Volatility Index to its highest reading ever in March.

Amazingly, the year ended with the S&P 500 higher by 16%, which represents a near-doubling of its average annual return since 1980. Not too shabby considering that the coronavirus disease 2019 (COVID-19) pandemic wreaked havoc on the U.S. economy.

A twenty dollar bill paper airplane that's crashed and crumpled into a financial newspaper.

Image source: Getty Images.

Historically speaking, when this happens, the stock market crashes

The question most investors are now asking themselves is if the market is overheating.

Think about this for a moment: Since the beginning of 1950, the S&P 500 has undergone 38 separate market corrections of at least 10%. That's one sizable move lower in equities every 1.87 years, on average. We may not know exactly when a crash or correction will occur, how long it'll last, or how steep the decline will be, but we know that one is always coming.

Even though we can't predict when a stock market crash will occur, we can certainly look to history for some helpful guidance. One such telltale sign is currently suggesting that big trouble is on the horizon.

The Shiller price-to-earnings (P/E) ratio is a P/E ratio based on the average inflation-adjusted earnings from the previous 10 years. Over 150 years of history, the Shiller P/E ratio for the S&P 500 has a mean (average) of 16.8 and a median of 15.8. Right now, the Shiller S&P ratio for the S&P 500 is 34.5 -- more than double its historic average.

A brown bear growling, with a plunging stock chart in the background.

Image source: Getty Images.

When looking back, there have only been five times in history where the S&P 500 has maintained a move above a P/E of 30: 

  • 1929: After the Black Tuesday crash, the iconic Dow Jones Industrial Average (DJINDICES:^DJI) went on to lose approximately 89% of its value.
  • 1997-2000: Before the dot-com bubble burst, the Shiller P/E ratio for the S&P 500 hit an all-time high of 44.2. Nearly half the value of the S&P 500 was wiped away after the dot-com bubble burst, with the Nasdaq Composite (NASDAQINDEX:^IXIC) hit even harder.
  • Q3 2018: Throughout much of the third quarter of 2018, the Shiller P/E ratio sat above 30. This was followed by a fourth quarter swoon that saw the S&P 500 lose as much as 19.8%.
  • Q4 2019/Q1 2020: Prior to the coronavirus crash in the first quarter of 2020, the Shiller P/E ratio had, again, crossed above 30. The S&P 500 lost 34% in 33 calendar days during the COVID-19 chaos of February and March.
  • Q3 2020-Current: To be determined.

Historically, when the Shiller P/E ratio for the S&P 500 gets above 30, bad things happen. Admittedly, it's impossible to predict when a pandemic might uproot the longest bull market in history. Nonetheless, history is pretty clear that when equities become roughly two to three times as pricey as their long-term average, a crash has followed relatively soon thereafter.

A young woman holding a financial newspaper while looking off into the distance.

Image source: Getty Images.

Even if a crash is coming, it's not time to panic

Before you run to your brokerage account to sell everything you own, let me impart three strong words of encouragement: Don't do that.

Even if history were to repeat itself and the stock market does crash relatively soon, history shows that holding onto your investments and adding to your long-term winners is a strategy with proven success.

Here are a few things to think about. First off, equities are set to benefit for many years to come from the Federal Reserve's historically dovish monetary policy. In an effort to stabilize markets and bolster the U.S. economy, the nation's central bank has pledged to keep lending rates at or near historic lows through 2023. This is an open invitation for growth stocks to go on the offensive and borrow at historically cheap rates.

Second, don't discount the role technology has played over the long run in promoting higher sustainable valuations. The advent of computers and the internet has broken down the information barrier that once existed on Wall Street. Today, John and Jane Q Investor have equal access to information as professionals on Wall Street. This ease of access to information has helped buoy a fundamentally pricier market.

Third and finally, history says long-term investors should remain upbeat. Despite 38 stock market crashes and corrections over the past 71 years, the S&P 500, Dow Jones Industrial Average, and Nasdaq Composite always, eventually, shrug off these declines and hit new highs. Since operating earnings for these indexes expand over long periods of time, this is what'll drive these major indexes higher.

Yes, a crash may be coming. But there's no question that any crash will represent a buying opportunity for long-term investors.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.