The cyclically adjusted price earnings ratio (CAPE) is the best predictor of long term stock market gains. You want to buy when the CAPE is low and sell when it's high.
The last two times that the was this high was right before the 1929 crash and right before the 2000 dotcom bubble burst. If the stock market doesn't scare the bejeezus out of you at this point in early September 2017, you need to get your head right.
This historical chart of the CAPE http://www.multpl.com/shiller-pe/ speaks for itself.