Why did my 401(k) earn 4% last year when the S&P was up 10%?

Happy birthday, bull run!
Happy birthday, bull run!

I missed out on the stock market rally last year.

After the New Year I checked my 401(k) and saw that I earned just 4% in 2016.

When I started talking to friends I realized that everyone else did better. Some did a lot better, including colleagues who have the same fund options I do.

It's not hard to see why. The Dow Jones closed 2016 up 13.4%, the S&P 500 earned 9.5%, and the Nasdaq finished up 7.5%.

I had set up my 401(k) like many experts suggest, putting my money in a mix of index funds. How could I be so far behind?

I decided to talk to some of those experts to find out exactly what I did wrong.

I guess it's time to face the fact that I might have made some rookie mistakes.

Mistake #1: Setting my expectations too high

Yes, the overall U.S. stock market had a great year, but that doesn't always translate to individual investors.

Like most people, I don't have my entire portfolio in U.S. stocks. So I can't expect the same return as the major indexes, said Eric Furey, a CFP at the wealth management firm RegentAtlantic.

Some of my money is in international stocks -- which performed poorly compared to domestic stocks last year. And a small portion is in conservative assets like bonds.

Turns out, the average investor made just over 5% in 2016, according to Openfolio, an app that tracks users' investments and lets them see how they stack up to others.

That made me feel better. But I still earned less than average -- and less than just about everyone I talked to.

Related: Will I ever be able to retire like my Grandma?

Mistake #2: Investing in a managed fund with high fees

Early in 2016, I had all my money in one fund. But I came to realize it wasn't a balanced fund like I had thought. Instead it was one of the most aggressive funds with the highest fees offered in my plan: $4.45 per $1,000. (As a comparison, my S&P 500 Index Fund charges $0.21 per $1,000.)

At that time, the aggressive fund was at a low. And while I hadn't paid too much in fees yet, I thought that staying invested could eat into my returns, especially if the fund continued to go down.

So I decided to sell and put my money in some lower-cost options.

Calculator: Will you have enough to retire?

Mistake #3: Panicking and selling low

I decided to take all my money out of that fund and put it in a more conservative mix of four new index funds (an S&P 500 index, a small cap index, an international index, and a bond index).

I'm ashamed to say, I made the move at what turned out to be the absolute worst time in 2016. The market fell, I took a look at my 401(k), and got jittery.

Buy low, sell high. I've heard the mantra plenty of times -- but I didn't listen.

"It's the simplest concept to talk about and hardest concept to execute. You're battling human emotion," Furey told me.

Money is hard. We're here to help. Email CNN with your money questions

Sure, I reinvested the money right away. But I sold the aggressive fund at its lowest point and didn't benefit as much from the market rebound later in the year because I had transitioned to a more conservative portfolio.

Mistake #4: Stressing out about short-term returns

I didn't do everything wrong. Overall, it was a smart move to diversify my portfolio in low-cost index funds. I just made the move at the wrong time.

"As a Millennial, it's important to stay smooth and consistent year over year," Furey said.

My job now is to stay the course and resist making any moves, especially when the market is down. Missing out on only a few days of positive performance can have a dramatic impact on my return, he said.

And I have at least 35 years before I retire, so there's plenty of time to make up for any losses. I'm sure to see plenty of ups and downs before I need to start drawing down from my nest egg.