This website has nice plots of data going back 90 years.
http://www.macrotrends.net/2577/sp-500-pe-ratio-price-to-earnings-chart
If I look at the SP500, and find the date when it reaches a maximum before a long down turn I find:
Date P/E Interest Rate
Aug 1929 21
Jan 1937 16
may 1946 22
Feb 1962 21 4.2
Nov 1968 19 5.7
Jan 1973 17
Aug 2000 29 5.6
Oct 2007 23 4.4
The P/E often rises sharply after the stock prices start to drop, presumably because the earnings then drop faster than the stock prices. This is surprising since the earnings should be delayed w/r to the stock price and stock prices can move faster.
The P/E usually drops by a factor of 2 or more before the start of a new bull market, although in Feb 2009, when the recovery started from the great recession the P/E was 104
Intuitively I would expect stocks to be a good investment, if the P/E is less than 1/(interest rate), but the data does not seem to support this.
Today the P/E for the SP500 is 25, I wonder how much higher stock prices can go?