Tech stocks’ wild ride makes the case for index-fund investing, says Wall Street guru Burt Malkiel

“Among the worst mistakes is to get swept up in either extreme euphoria or in waves of unrelenting pessimism.”

Burt Malkiel, the author of the bestselling investing book A Random Walk Down Wall Street, tells Fortune that trying to get in on individual AI stocks now could be a big mistake for the average investor. Just look at the shakiness of the markets over the past few weeks.

“There is such clear evidence by looking at individual investors, you see the ones who traded the most are the ones who lost the most money,” says Malkiel, who is now Wealthfront’s chief investment officer. “All nobody can time the market, don’t try to do it. And if you do, you are much more likely to get it wrong than get it right.”

In a letter to Wealthfront investors released Tuesday, Malkiel reminds readers that trying to pick a sector of the stock market that will outperform the rest is akin to trying to time the market: a losing prospect. The best practices for building wealth via investing remain the basics, including “broad diversification, indexing, minimizing costs and taxes, rebalancing, and staying the course.”

“Equally important is to avoid the common mistakes that have crushed even the best-laid investment plans,” he writes. “Among the worst mistakes is to get swept up in either extreme euphoria or in waves of unrelenting pessimism, both when it comes to the market as a whole and the performance of specific sectors.”

Malkiel notes that the best way to actually earn a decent rate of return from investing in the broader market is by buying and holding for long period of times—not jumping in and out of the hot sector of the moment. Timing rarely works out long-term; in fact, research has shown that many investors miss out on many of the best days of the market when they try to time their investments, preventing them from realizing the biggest gains. Investors are much more likely to sell at the bottom and buy at the top than the reverse.

He uses the ARK Innovation Fund (ARKK) to exemplify that trend. The fund went from selling for around $50 a share in 2020 to over $130 a share in early 2021, after interest in artificial intelligence companies took off. Investors started “pouring several billion dollars per month into the fund,” Malkiel writes, when prices were at their peak. The enthusiasm eventually subsided, and ARKK’s price fell back to around $47 a share by April 2022; investors withdrew their money, leading to major losses.

“As the ARKK example demonstrates, even when investors correctly pick a high-performing sector, timing errors can lead to negative returns,” he writes.

Instead of trying to get in on the buzziest stocks, Malkiel encourages investors stick with dollar-cost averaging, or consistently investing money each month regardless of what the market is doing. With this strategy, investors buy regardless of what the market is doing; over time, the highs and lows more or less even out.

In that regard, index funds are still king. And a broad-based fund solves the problem of picking sectors as well, because they give meaningful exposure to the sectors producing the best returns.

“The beauty of owning a broad index is that you’re likely to get exposure to that AI winner in your portfolio anyway,” he writes.

Rather than trying to pick stocks, Malkiel encourages investors to focus on what they can control, including the cost of their investments. Keep fund fees and taxes minimal, and that will have more of a positive affect long-term on their performance.

“The long-run way to build wealth is to just keep on going,” he says.

Recommended Newsletter: The Fortune Next to Lead newsletter is a must-read for the next generation of C-suite leaders. Every Monday, the newsletter provides the strategies, resources, and expert insight needed to claim the most coveted positions in business. Subscribe now.