Investors have been left reeling after one of the worst months on record in October. All told, October was the worst month for the broad market since 2011 - and the worst for tech stocks in particular since the depths of 2008's selloff.

That's the bad news.

The good news is that the data show last month's awful stock market performance could actually set the stage for a path to new highs in the months ahead.

First, it's worth looking at what October typically looks like for investors. Contrary to what some investors seem to think, October isn't typically a bad month for stocks. In fact, over the last three decades, October has tended to be a positive month for stocks most of the time - but it also tends to be a more volatile month, with bigger outlier years than other months.

We certainly got one of those in 2018.

But that's not a bad thing. Negative Octobers have actually gone hand-in-hand with big rallies in the months that followed. Since 1987, the only years where a negative October wasn't followed by a rally in November were major bear markets of 1987, 2000, and 2008.

That's promising for the month ahead.

Even more promising is the fact that deeper October drawdowns in non-bear market years actually resulted in stronger buying than flatter years. When the S&P 500 was down 2% or more in October in a non-bear market, it hit new all-time highs within 90 trading sessions, on average.

TheStreet Recommends

That jives with the long-term technical picture that's setting up on the chart:

Image placeholder title

The chart above shows the weekly price action of the S&P 500 stretching back to the end of 2014. At a glance, it's not hard to spot the predominant trend in the stock market - it's been moving up and to the right.

That said, October's selloff did violate the trendline that connected the 2016 lows and February's correction. But with higher lows still in place from October, the most important takeaway is that the stock market's uptrend remains intact here.

That's verified, in part, by the fact that momentum has managed to hold its bull market low-zone, holding above "oversold" territory that we'd expect to see in a true bearish trend reversal. That's a good thing.

Statistically, November does tend to be a stronger month for investors than October. And that, coupled with the technical picture, paints a much rosier picture for the final stretch of 2018.

Note: Here's what November's midterm elections could do to the markets.

Make Money on Closed-End Mutual Funds. TheStreet's Robert Powell recently hosted an all-star panel of experts who explained everything you need to know on closed-end mutual funds, and often-overlooked investment class. Click here to register and watch for free.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.