Picture this: It’s the NBA Finals, and LeBron James has just drained a jump shot for the Cleveland Cavaliers. Then he hits another. And another.
He’s on a hot streak: three in a row. He’s going to hit the next one, right?
Most people would unhesitatingly reply, “Yes.” That assumption doesn’t say as much about King James’s skills as it does about the inner workings of your own brain. Indeed, a whole lot of evolutionary history is packed into that projection. But here’s the thing about that hunch: It’s off the mark. Statistically, LeBron isn’t significantly more likely to make the shot than he is to clang it off the back rim—streak or no streak.
More from FORTUNE
This leaping-to-conclusions phenomenon is called “recency bias,” and it’s deep in our emotional wiring. “It’s an interesting effect,” says Dan Ariely, a professor of behavioral economics at Duke University and the author of books including Predictably Irrational (and the originator of the hoops analogy). “We look at the most recent evidence, take it too seriously, and expect that things will continue in that way.”
There’s an evolutionary advantage to this. Think back to the origins of humanity somewhere on the African savannas: If the wildebeests have shown up at the same watering hole a few days in a row, odds are we’re going to hunt at that same spot the next day. Nowadays, though we’re hunched at computers instead of hunting game, we still instinctively seek patterns in the events that have happened most recently, while memories of older occurrences have less influence over our behavior.
The problem, of course, is that the wildebeests don’t always come back. And that makes recency bias particularly dangerous for investors: Unchecked, it’s your brain’s very own portfolio killer. Intellectually, we know that the market already saw two brutal bear markets this century—in 2000–02 and 2007–09. But as we approach the eighth birthday in March of the second-longest bull market in modern times, recency bias can lull us into a false sense of security, especially given the very good returns of the past three or four years. “If you think about the creation of asset bubbles, that’s always what happens,” Ariely says. “Things go up and up and up, and we start thinking it has to always go up.”
Market professionals are hardly immune to this trend. At the beginning of 2008, trouble signs were emerging in the global economy. But after five straight years of positive returns, sentiment among equity analysts neared an all-time high, with the Wall Street consensus calling for an 11.1% gain, according to a recent study by Bespoke Investment Group. Their calls were based in part on—you guessed it—analysis of the recent past. We all know what happened next: The economy went off a cliff, and the S&P 500 fell 38.5% that year.
Recency bias also helps explain retail investor behavior during times of greed or panic. Assets often flow into stocks near market tops and exit at the bottom—exactly the opposite of what investors should be doing, says David Santschi, CEO of TrimTabs Investment Research. Recent signs here aren’t encouraging: Net inflows for U.S. stock mutual funds hit $27.8 billion in December, according to fund research shop Morningstar—the highest monthly total since April 2000, at the dawn of the tech-stock crash.
Investors can be particularly susceptible to recency bias as they get closer to retirement—exactly the time when they can least afford big losses. That’s part of the mechanism of coping with aging, according to Shlomo Benartzi, a behavioral economist and UCLA professor. If we felt constantly hamstrung by the bad things that have happened to us over the course of our lives, none of us would get out of bed. But those rose-tinted glasses can cloud investing decisions, leading savers to assume too much risk at the tail end of a bull market.
Looking ahead, few experts are predicting the imminent arrival of a bear market—then again, few ever do. So how can you combat and counteract your own recency bias and resist letting excessive optimism (or pessimism, for that matter) hurt your decision-making? For starters, you could put your portfolio on autopilot, taking your mood swings out of the equation. That might mean vehicles like target-date funds, which shift investment allocations automatically to make them less risky as the account holder ages. Also helpful: robo-advisers such as Betterment and Wealthfront, which can be set up to rebalance your portfolio automatically when the prices of one asset class get out of whack. “I’m a big fan of any investing approach that removes us from impulse-based decisions,” says Lisa Kramer, a behavioral economist at the University of Toronto.
It’s also worth keeping historical data in your decision-making arsenal. The average bull-market length is 54 months, according to J.P. Morgan Asset Management—41 months shorter than the Obama-Trump bull run, through January. And the S&P 500 long-term average price/earnings ratio? It’s just 15, compared with more than 25 today. That kind of wider context signals that today’s valuations and recent good times won’t be easy to sustain.
All the more reason to make sure that, if and when the market does turn, any moves you make will be driven by a long-term plan rather than the emotions generated by the last thing you heard on CNBC. With major indexes setting records, it’s a good time for investors to rebalance: If the equities portion of your portfolio has ballooned from your 60% target to 75%, say, take some profits off the table and use them to buy asset classes that are hardier during downturns, like investment-grade bonds. Older investors may want to move that money into assets that are even less risky, like cash or annuities.
“In investing you have to deny your emotions, like Odysseus sailing by the sirens in Greek mythology,” says Raife Giovinazzo, research director at Fuller & Thaler Asset Management. “Put wax in your ears or tie yourself to the mast—otherwise, you’re going to drown along the cliffs.”
Click here for more articles from Time Inc.’s Looking Forward series.
How to Beat Your Biases
Deep-rooted mental habits, including “recency bias,” can throw off investors’ decision-making and hurt their portfolios. Here are three ways to keep those habits in check.
Watch out for high prices
Unusually high price/earnings valuations are often a sign that the party for stocks has gone on a little too long. With stocks trading well above their averages, now may be a good time to sell big winners and put the profits aside.
Play it safe for retirement
The years immediately before and after retirement are when losses can hurt an investor’s long-term plans the most. Savers in that life stage should consider putting more money in cash and bonds—no matter how bullish they feel.
Rely on an autopilot
When emotions run high, it helps to have tools that discourage buying or selling on impulse. Target-date funds, “robo-advisers,” and annuities can help investors avoid taking excessive risks in good times or panic selling in bad.
A version of this article appears in the March 1, 2017 issue of Fortune with the headline “Beware of Happy Memories.” We’ve included affiliate links in this article. Click here to learn what those are.