A. Andrew Smithers has a paper "Hindsight Value: U.S. Equities" which did a quantitative study at the various metrics and their abilities to foretell the timing of selling a stock. (while Andrew's paper is not publicly available, you can find the essential ideas in the content of a course "Practical History of Financial Markets" posted online, he is one of the authors).
The metrics he looked at and the conclusions are below:
Yield on CD and bonds.
The theory is the lower such yields, the higher stock market returns. The finding? R-square between 0.11 and 0.15. Conclusion: not related at all.
Trailing PE / Forward PE
Compare a stock's current price with last year or next year's earning.
The theory is that the lower the trailing PE or forward PE, the cheaper a stock is. The finding? R-square of 0.22 to 0.25. Conclusion: poor indicators.
Shiller PE
Cyclically-Adjusted PE, it compares stock prices to the average earnings of the past decade.
This ratio was popularized by Nobel Laureate Robert Shiller. The finding: R-square of 0.52. Conclusion: OK, but not good.
Tobin's q
Compare a stock's current price with the company's net assets (adjusted for inflation). The theory is you can spend the same amount of money either buying all the assets (start from scratch) or buy the company (buy the stocks). If Tobin's q is less than average, then it's time to buy the stock. The finding: R-square 0.79. Conclusion: the best metric we have found so far.
The good news is Tobin's q data is readily available for every investor!
Andrew Smithers also has a book with more detailed explanation on this critical metric - Valuing Wall Street : Protecting Wealth in Turbulent Markets.