From Bob Irish, retirement expert, Palm Beach Research Group: Before “retiring,” I spent more than 30 years in the financial services industry watching the same movie over and over. The plotline and the cast of characters never changed. The flick goes like this:

A good market begins. Investors watch stocks rise in disbelief. Surely this market can’t keep going up, they say. Finally, late in the cycle, investors become believers and buy stocks. Shortly thereafter, the market tops.

As a bad market begins, investors watch stocks decline in fearful disbelief. Surely the market will bounce back, they say. As the market declines further, confidence dissipates. Close to the bottom, investors throw in the towel and sell their stocks.

Soon, another good market commences, but these same investors who lost all that money by coming in too late now refuse to buy because they are scared. They won’t venture in again until late in the cycle when stocks seem “safe.” And the market is close to another top. And round and round we go.

When you see this movie as often as I did, you start to wonder if the old adage “you can’t underestimate the intelligence of people” is right. But I knew this wasn’t true. Many of the worst investors I knew were doctors, lawyers, and college professors—even one mathematician. It’s not a question of stupidity. It’s written in our DNA.

There is an organ inside all of us that makes it difficult for us to succeed as investors. I’m not talking about our greedy hearts. I’m talking about our Paleolithic brains.

Neurobiologists tell us that we have three brains: a smart one (the neocortical brain), an emotional one (the limbic brain), and an instinctive one (the basal ganglia). In making decisions, we use all three parts of our brain, but sometimes—when we are in crowds—the instinctual brain dominates. It’s known as the herd instinct.

For our ancestors, mimicking other people was a smart thing to do. Confronted by other tribes and stronger beasts, we found safety in numbers. People who did this naturally survived and reproduced more easily. Thus was this behavior gradually encoded into the primitive “reptilian” part of our brain.

The herd instinct is a form of animal intelligence that serves us in some situations (people in a theater suddenly begin rushing to the exits). But when it comes to investing, this instinct almost always takes us down the wrong path.

Cavemen Underperform the Stock Market

Dalbar, a leading market research firm, quantifies the tremendous gap between investment results and investor results. Its latest study shows the average equity mutual fund investor had returns of just 3.66% over the last 30 years. The S&P averaged 10.35% over the same time frame.

That means that if you had invested $100,000 in the market years ago, it would be worth $1,419,011 today (according to this calculator) versus just $293,992 for the average investor. That’s more than a million-dollar difference!

And this study is hardly a fluke. Every year, the Dalbar study, along with many others, has reached the same conclusion. Equities do well. People? Not so much.

Can You Tame Your Inner Caveman?

When Mark Ford said, “We can tame the caveman,” I was all in.

But how do we do it? How do we subdue an instinct that is so deep as strong as the instinct to follow the crowd? How do we learn to override emotions and instincts with reason?

Let me tell you some of the behaviors that cavemen exhibit… and how to stop them:

Cavemen Buy High

Your natural instinct is to purchase the things you think everyone else is buying—the things that are on the rise. But when something has been on an upward tear, it might not be the best time to get in. The best way to thwart your inner caveman is to adhere to strict buy-up-to prices. This way, the herd instinct doesn’t come into play. (There is an old saying in the real estate business: “You don’t make money when you sell real estate. You make it when you buy it.” The same is true in the stock market.)

Cavemen Sell Low

Back in 1995, I discovered Alliance Pharmaceuticals (ALLP). It made radioactive seeds for treating prostate cancer. This was a new technology at the time. I took the plunge at around $40 per share and rode it up to just over $100. Then the stock started going down. I held on. I hoped it would come back. It didn’t. I finally sold in late 1998 for around $27 per share. I had held on because my inner caveman couldn’t stomach a loss.

I now use trailing stops. Trailing stops would have prevented this disaster. And, in my case with ALLP, a trailing stop would have taken me out at $75 and insured a profit.

Remember, even the best stock pickers are right only 60% of the time. So it’s important to cut your losses early. Because if a stock goes down 50%, it has to be up 100% to get back to even. That’s just the math. And if you are down that much, your inner caveman may not let you sell. Trailing stops make this decision automatic.

Cavemen Like a Story

Before the printed word, our ancestors passed down their histories orally in the form of stories. And stories remain one of the most powerful forms of human communication.

I used to be a sucker for the story stock. You know, the company with a breakthrough this or that. The next Google or Apple or whatever. It’s usually a ground-floor opportunity. And something not too many people know about.

Well-meaning friends or colleagues typically deliver these tips. I’ve lost lots of money on these story stocks over the years. I still like to hear the stories. What caveman wouldn’t? I simply don’t buy them anymore. I’ve found out over the years that home-run stocks are few and far between.

Taking a chance on them is a great way to make a small fortune, if you start out with a large fortune.

Cavemen Worry About the Next Bad Market

The good market we’re in right now will get ugly. I can promise you that. Most investors will fall back on their ancestral training. Emotions and instincts will rule the day. Logic and reason will be in short supply.

It’s difficult to prepare mentally for the emotions that accompany a bad market. In a good market, it’s hard to remember what being in a bad market actually feels like. And vice versa.

It’s kind of like how, when you’re well, you can’t imagine ever getting sick again. And you forget what being sick feels like. But when you get ill, you remember. And when you’re sick, you may wonder if you will ever be well again. It’s easy to forget how it feels to be healthy.

The markets are cyclical, just like our health. But when the next bad market arrives, tune out the inner caveman. Buy quality stocks and don’t pay too much for them. Let your trailing stops prevent disaster.

View market imbalances as opportunities, not as threats. They say that more millionaires are made in bad markets than in good markets. They just don’t know it at the time.