A man sweeping the floor after the Wall Street crash in 1929. Wikimedia Commons Stocks are getting a bit pricey.

All three major indexes break though their all-time highs on a seemingly daily basis, and this has pushed earnings multiples higher and higher.

The current 12-month trailing price-to-earnings ratio of the S&P 500 sits at 25.95x, while the forward 12-month price-to-earnings is roughly 17.1x, according to FactSet data. Each of these is higher than its long-term average.

In fact, based on one measure of valuation, the market hasn't been this expensive anytime other than before a massive crash.

The cyclical adjusted price-to-earnings ratio, better known as Shiller P/E, which adjusts the price-to-earnings ratio for cyclical factors such as inflation, stands at 27.86 as of Friday. There have only been a few instances in history when stocks have been this expensive: just before the crash of 1929, the years leading up to the tech bubble and its bursting, and around the financial crisis of 2007-09.

This does not necessarily mean that a crash is imminent — during the tech bubble, the Shiller P/E made it well into the 30s before coming back down. Additionally, there are some criticisms that Shiller P/E is generally more backward-looking since it adjusts for the cycle, so it may not be as accurate.

Another caveat is that, during the three previous instances, investors have been incredibly bullish on stocks (there's a reason Robert Shiller's book is titled "Irrational Exuberance") and most indicators of sentiment — from the American Association of Individual Investors to Bank of America Merrill Lynch's sell-side sentiment indicator — are still depressed.

Still, an elevated level for the Shiller P/E certainly isn't going to make it any easier to sleep at night.