The stock market has been roaring ahead in the last part of December, with investors taking full advantage of a Santa Claus rally to enjoy further gains. The Nasdaq Composite (^IXIC 0.10%) has been lagging behind the record performances of its fellow benchmarks, but even the Nasdaq saw solid gains on Thursday afternoon, rising more than half a percent as of 1:30 p.m. ET.

Nasdaq stocks have pulled back somewhat in the past month, but the index has nevertheless been a stellar performer in 2021. That has many investors wondering whether 2022 could bring even better gains for the index -- or whether they should tone down their expectations after such an impressive run.

Cranes putting the numbers 2022 into place.

Image source: Getty Images.

Huge gains continue

There's still more than a day of trading before Wall Street closes the books on this year. But based on where the Nasdaq stands today, 2021 will go down as another successful year that defied many people's expectations.

The Nasdaq is up more than 22% so far for the year. That marks the ninth gain in the past 10 years for the index. Over that span, the Nasdaq has risen more than 500%, for an average gain of almost 20% per year.

What's especially impressive about the Nasdaq's performance this year is that it followed two even stronger years. The index rose 35% in 2019 and then 44% in 2020, despite seeing a big bear market move downward at the beginning of the COVID-19 pandemic in March 2020. This year's economic rebound has helped bolster sentiment about the stock market generally, and even a cooling of interest in high-growth tech stocks hasn't hurt the Nasdaq dramatically.

What will 2022 bring?

It's tempting to think that after three strong years that have produced gains of almost 140%, the Nasdaq is due for a downward year. It's true that there's always a chance of an extended stock market pullback. There's no question that valuations are at levels that many investors find stretched at best, with some seeing the potential for a crash being well above average.

However, the same arguments have been true in the past, and the Nasdaq hasn't always done what investors feared. 2021 is a great example, as some believed that the pandemic merely pulled forward demand rather than creating sustained growth. Many Nasdaq stocks are well off their highs from earlier in the year, but on the whole, the index has defied bearish calls.

The Nasdaq's run of gains in the 2010s is an even stronger example of how betting on a pullback can be costly. Three years of double-digit percentage returns from 2012 to 2014, including a 38% rise in 2013, led many investors to believe a pullback in the Nasdaq was imminent. However, the index continued to rise for the next three years, including a 28% jump in 2017. When the decline came in 2018, it was mild, with investors suffering losses of just 4%.

What to watch

Even with those long-term assurances, you can bet that investors will watch certain things closely. The Federal Reserve could play a key role, with its interest rate policy decisions having a big impact on high-growth stocks. Also, those who own individual stocks will look for the companies most likely to outperform the index.

Trying to guess whether a given year will be a winner or a loser is usually more costly than successful. The best way to proceed is to keep a mindset that puts you into top-quality stocks that you can hold for the long haul.