As stocks have become mighty volatile, long-term investors could be induced to become more short-term oriented in their thinking, buying stocks on a single day's rally, or selling after a swift 11 percent decline, such as we saw from Wednesday to Tuesday.

Read More Dow, Nasdaq out of correction on intraday basis; oil bounce helps energy

Based on the historical performance of the , it's that second decision—the fear-based move to sell—that is the more dangerous one. In fact, even if one was the world's worst market timer over the past several decades, one still made money on stocks, according to an analysis done by institutional portfolio manager and financial writer Ben Carlson.

He names his awful (or perhaps unlucky) investor "Bob." Bob made his first investment in the beginning of 1973, right before a 48 percent crash for the S&P 500. Bob then held onto stocks after the drop, saving a total of $46,000, and not getting up the gumption to commit more savings until September 1987—right before a 34 percent crash. Bob then continued to hold tight, making only two more investments before retirement, which came right before the 2000 crash and then the 2007 crash!

So how did "Bob" do after these 42 years of epic market misfortune? Actually, he made money. As the market successively made record highs, Bob turned the $184,000 he invested over the years ($6,000 in 1973, $46,000 in 1987, $68,000 in 2000 and $64,000 in 2007) into $1.16 million—for a total profit of $980,000. That represents an annualized return of roughly 9 percent, on a money-weighted basis. Even after accounting for inflation, Bob has increased his wealth substantially by investing in stocks.

The key is that Bob never, ever sold his holdings—instead riding the stock market's long-term trend higher.

This hypothetical analysis reveals that it's critical "to really understand your time horizon," Carlson said in a "Trading Nation" interview Wednesday. "And then you also have to really understand that in the short or intermediate term—as we've seen over the past couple weeks—anything can happen and those market crashes can occur."

For that reason, "if you have spending needs in the next few years, you definitely have to diversify your assets and have more safety in your portfolio."

On the other hand, if one's investing horizon is several decades long, then the stock market has proven to be an extremely good bet, provided one didn't attempt to be "smart" by jumping out when one believes downside is ahead.

Of course, whether the future will resemble the past remains an unanswerable question. Some investment professionals doubt that the market can keep rising an average of 10 percent or so a year, particularly if U.S. growth remains slow. In stagnant Japan, for instance, the Nikkei index is essentially flat over the last two decades.

But as long as stocks continue to rise over the very long-run, the next "Bob," who is just starting to save and is now considering buying stocks, would do well to follow his predecessor's lead—even if he proves to be the second-worst market timer ever.