Yes, I've heard that a million times, but that kind of advice presupposes a bull market. What if it's 1967, and you're about to go into a 15 year period of up and down markets, with no real growth in stock prices? And that's before inflation; the market fell substantially during the horrible 70s if measured in real dollars. All kinds of stock enthusiasts (like most folks here) got eaten alive. Pessimism reigned by the early 80s. Most people said "I'll never buy stocks again.".
Ironically, when investors finally capitulated, the great bull market of the 80s and 90s started.
My point is that most people here are mesmerized by that bull market, and by recent gains. But historically the indexes have had huge, long term swings that probably exceed most people's investment horizon.
"Past performance is no guarantee of future results" is not just a legal disclaimer. It's a bitter truth. Our current optimism is strongly colored by recent gains.
What if you had retired in 1929? You would have received nary a return for 25 years.
Sure, indexes average 8 percent or so, over the very long term, but it can be an intolerably long averaging interval.