October was an ugly month for the stock market, and investors got a nasty reminder of exactly how quickly good times can turn to bad. By the end of the month, the Dow Jones Industrial Average (^DJI -0.12%) had fallen almost 1,350 points, losing more than 5% and suffering its worst monthly performance since January 2016.

Yet one thing that's important for investors to understand about following major market benchmarks is that they never accurately reflect the behavior of all of their constituents. Even though the Dow has only 30 stocks, they rarely move in unison. Indeed, nine stocks actually gained ground for the month. But the four below -- IBM (IBM -0.35%), Caterpillar (CAT -0.43%), DowDuPont (DD 0.72%), and Home Depot (HD -0.60%) -- all lost 15% or more.

Chart with worst stocks in Dow during October.

Data source: Yahoo! Finance. Chart by author.

All of these stocks had problems that hit them especially hard. IBM has been unable to restart its growth engines despite numerous attempts, while investors feared that Home Depot would struggle along with home-improvement peers as higher interest rates hurt the housing market. Meanwhile, both Caterpillar and DowDuPont have seen pressure from trade tensions and rising raw material costs, and it's unclear whether either of those issues will get resolved favorably in the near future.

Even with the sharp decline, though, the major takeaway for investors is that you can't afford to panic during market swoons. Occasional drops like this will happen, and some individual stocks will take even bigger hits. Yet in the long run, successful companies deliver solid returns to their shareholders, and it's critical to keep a long-term perspective in order to maintain your resolve and stay on track with your strategic plan for your portfolio.