Are you quick to pull the trigger when you think the stock market is going to attack the money you’ve worked so hard to amass?

Then your behavior is probably costing you a fortune, and you might want to hesitate the next time you think you should grab your money and run for safety.

Boston financial research firm Dalbar has recently quantified what nervous investors have cost themselves. During the last 20 years, a simple investment in the stock market would have provided an 8.19 average gain per year. But the average person with stock mutual funds ended up with only 4.67 percent annually, Dalbar found. The firm studied returns for 20 years through the end of 2015.

The major reason why people earn so little, according to Dalbar’s analysis, is that people yank money from their investments when losing. After all, the stock market — or the Standard and Poor’s 500 Index — doesn’t actually gain 8.19 percent each year. That’s merely the average. It’s a blend of horrifying losses like the 38 percent loss in 2008, with the sweet gains of 30 percent in 2014, and everything in between. For the last 20 years, or even the last 89, there have been more ups than downs in the stock market. So the person who pulls the trigger when spooked usually misses many of the delightful gains that show up without warning.

Dalbar analysts looked at when money flowed into and out of mutual funds that invest in stocks and bonds. And they compared those findings to the stock market and money going into money market funds. Money market funds, of course, are one of the safe places where people park money when they are worried.

Numerous other studies have come to the same basic conclusion as Dalbar: People are awful at guessing when the spooky times and the delightful times in the stock and bond markets will come and go. And that costs them dearly. Even the smartest investment pros have a terrible track record with guessing. So rather than make futile guesses, financial advisers typically tell clients to expect losses at times, but to stick with mixtures of stocks and bonds in good times and bad. Typically, bonds help protect people from losses when the stock market turns cruel.

Dalbar’s analysis blames panicking and selling during stock market losses as the major issue for investors. It accounts for 44 percent of the difference between the 4.67 percent that individuals earned in their stock funds and the 8.19 percent that the stock market would have bestowed, Dalbar reports. Another 15 percent is lost because people hold onto their cash after the stock market has tanked, and then they miss the opportunity to make money as stocks rebound.

The mistakes don’t simply exist in stock fund investing. Dalbar found that while the Barclays Aggregate Bond Index earned on average 5.34 percent a year over the last 20 years, investors in bond funds earned just 0.51 percent annually.

While Dalbar blames investor decision-making for most of their lagging returns in stock and bond funds, that’s not the only problem. Fees also erode returns. The analysis blames fees for 22 percent of lost opportunity.

While some people don’t realize it, they are always paying fees when investing. That’s true whether they invest in 401(k)s and IRAs, go straight to a mutual fund company, or buy funds and individual stocks and bonds through a broker or financial adviser.

People have also have lost the opportunity to make the full 8.19 percent average annual gain in the stock market during the last 20 years because there are times when they don’t invest.

“Maybe they’ve lost their job, or are saving for a house down payment or sending children to college,” said Louis Harvey, president of Dalbar. Those times away from stock fund investing explain another 19 percent of the erosion in investors’ ultimate returns.

Some observers, such as financial planner Michael Kitces, have faulted Dalbar’s methodology and the size of the losses it’s reported. Critics also claim that the study has been a delight to financial advisers, who use it to convince individuals that they are dummies who need help from a pro.

But they don’t argue that market timing gets individuals into trouble. A 2014 Morningstar study showed individuals lost 2.5 percent through bad timing with mutual funds. Morningstar has also shown that the pros have their weaknesses, with few funds staying outstanding over several years.

So the message from all the studies is to beware if you think you know when to flee or jump into the stock market. Further, beware of any pro who claims he or she can do it too.

As you comment, please be respectful of other commenters and other viewpoints. Our goal with article comments is to provide a space for civil, informative and constructive conversations. We reserve the right to remove any comment we deem to be defamatory, rude, insulting to others, hateful, off-topic or reckless to the community. See our full terms of use here.

For a person who often misses sleep, the research I recently heard on the radio from a neuroscientist specializing in that subject was unsettling at best. According to Matthew Walker, and the science he references in his book “Why We Sleep: Unlocking the Power of Sleep and Dreams,” insufficient sleep is linked to everything from obesity and suicide to a...

The problems that have plagued Minnesota’s vehicle registration and title system have cost license centers at least $2.7 million and probably closer to $4 million, according to a report by a group representing the license centers. The cost is still growing daily and could exceed $10 million, according to the Minnesota Deputy Registrar’s Association, which recently surveyed its members to...

A class-action lawsuit accusing CenturyLink of overcharges and unauthorized charges will be handled in Minnesota. The decision means a Minnesota judge will preside over the case, which dozens of attorneys are involved in. “Minnesota is a jurisdiction in which there were pending lawsuits and many consumers had been wronged,” said Lori G. Feldman, a lead attorney on the case. Customers...

Cookie Cart produces more than just delicious snickerdoodle, chocolate chip and hand-decorated cookies. The Minneapolis-based nonprofit also claims to “bake bright futures” by training low-income teenagers in every aspect of the business, from marketing to distribution, on top of soft skills such as business etiquette and résumé-building. The job-training company, which is expanding to St. Paul’s Payne Avenue in April,...