The S&P 500 index enjoyed its biggest first-quarter gain this year since 1998, which made me wonder: How many people missed out on this rally? The growth came after the index was walloped in the fourth quarter, with the index down 13.55% for that period. Surely, the thought of cashing out passed through many investors' minds.  

Suppose you did get spooked last year, and you gave up by selling off your positions, trading your investments for cash. Eventually you'll get back in the market when the worst is over, you tell yourself. That sounds like a reasonable strategy. However, waiting it out also means potentially missing some very big up days in the market, which makes an enormous difference in your portfolio's performance over time. 

Senior man and woman sitting at a table looking concerned.

If you're thinking of getting out of the stock market after a drop, you may be giving up big gains on the rebound. Image source: Getty images.

Time in the market, versus time out of the market

J.P. Morgan Asset Management's 2019 Retirement Guide shows the impact that pulling out of the market has on a portfolio. Looking back over the 20-year period from Jan. 1, 1999, to Dec. 31, 2018, if you missed the top 10 best days in the stock market, your overall return was cut in half. That's a significant difference for only 10 days over two decades!

Here's how a $10,000 initial investment fared over the past 20 years depending on if its investor stayed invested or instead, missed some of the market's best days.

January 4, 1999 to December 31, 2018 Dollar value   Annualized Performance 
Fully invested (S&P 500 index) $29,845 5.62%
Missed 10 best days $14,895 2.01%
Missed 20 best days $9,359 -.33%
Missed 30 best days $6,213 -2.35%
Missed 40 best days $4,241 -4.2%
Missed 50 best days $2,985 -5.87%
Missed 60 best days $2,144 -7.41%

Source: JP Morgan.

You don't have to miss many good days to feel the impact. The return went from positive to negative by missing the 20 best days of the market over 20 years. Putnam Investments found similar results by studying the data from 2003 to 2018. If you were fully invested in the S&P 500, your annualized total return was 7.7% during that time. But if you missed the 10 best days in the market, it dropped to a paltry 2.65%.

Missing out compounds over time  

If you're guilty of missing some of those really big days in the market, you're not alone. Investment research firm Dalbar publishes an annual survey of the average investor's performance versus the benchmark. Dalbar studied retail equity and fixed-income mutual fund flows (money in and out of the fund) each month from Dec. 31, 1997 to Dec. 31, 2017 to calculate the "average investor" return. The average investor performed below average when compared to buying and holding the S&P 500 index.  

The below table demonstrates that in the 20 years from 1997 to the end of 2017, the average equity investor saw returns of 5.29%, versus the index which was up 7.2%, marking a difference of almost 2 percentage points (based on average annual total returns). The average fixed-income investor fared even worse. Over the same time period, the Barclays Aggregate Bond Index was up 4.98% but the average fixed-income investor was up only 0.44%. One of the main reasons average investors lagged the benchmark was due to mistiming the market or missing the up days.  Here's how a $100,000 initial investment fared from Dec. 31, 1997 to Dec. 31, 2017, depending on how it was invested.

  Ending dollar value  Average annual performance
Average equity investor $280,377 5.29%
S&P 500 index  $401,346 7.2%
Difference  $120,969 1.91%

Source: American Funds and Dalbar. 

The Dalbar study highlights how missing a few of the market's up days leads to lackluster performance over time. Of course, the reverse is true, too. If you are out of the market, you also miss the worst days too. But over time, as demonstrated by the two tables, if you're going to invest in the equity markets, you have to be in it to win it, which means riding through the bad days to get those good days.

Many of the best days in the market come right after the worst days. According to the J.P. Morgan study, six of the 10 best days occurred within two weeks of the 10 worst days. One example was in 2015: The best day was Aug. 26, just two days after the worst day in the stock market that year. 

The lesson here is that investors are rewarded for sticking to their investment plan and riding out the bad days in the market over time. It may seem harmless to wait out the bad days with your money, but this also means missing the up days that should boost performance over time.

One way to help your portfolio weather an impending storm in the stock market is through smart asset allocation -- having money in both stocks and bonds. Traditionally, bonds have done well when stocks slide. Asset allocation can lower the volatility in your portfolio. Fewer hiccups in your portfolio may help keep you from panicking and selling out in the tough times like last year. The bottom line is: Don't miss the market's good days!