With just a few days left in the year, it looks like the S&P 500 Index will deliver a gain of 20% or more for 2017. Investors should be happy about that.

But, instead, many will worry. They worry the gains won’t last and 2018 will deliver a loss.

Data says those worries are misplaced. After a good year, history tells us to expect another good year.

On average, since 1950, the S&P 500 Index gained 8.9% a year. The index ends the year higher 71.6% of the time.

But, after a gain of 20% or more, the index gains an average of 11.2% in the next year. And the win rate jumps to 83.3%.

This means investors should be excited about 2018. They should invest aggressively until there is a clear sell signal. A close below the 200-day moving average could be a sell signal, although there are other, and better, signals.

Selling early means missing out on gains. And the gains after a good year could be substantial.

In one recent case, a winning streak in the stock market produced life-changing gains for investors.

The longest streak of big gains started in 1995. For five years in a row, the S&P 500 gained at least 20%. Gains averaged 28.8% a year. Over that time, a $1,000 investment grew to $3,475.

Could that happen again? Yes, it can.

And that’s important to remember. We could see big gains for a few years in a row.

So stay invested until the market turns down. None of us can afford to miss a bull market.