Wall Street has been known to get irrational, which can open up long-term opportunities for investors that buy and sell based on decades-long plans, not days-long. The latest example of this involves two industrial stocks, Stanley Black & Decker (SWK) and Rockwell Automation (ROK -1.29%). Both stocks are trading at steeply discounted prices that are unlikely to stay that way.

Here's a quick look at why you might want to step into each of these industry-leading stocks today and hold on for the long term.

Half off is about right, right now

To be fair, investors with short-term mindsets probably aren't too off base in their reaction to Stanley Black & Decker's earnings guidance for 2022. At the start of the year, management was calling for adjusted earnings of around $12 to $12.50 per share. By the end of the second quarter that had fallen to just $5 to $6 per share. That's more than a 50% decline, which roughly mirrors that stock's roughly 60% decline from its early-year peak.

A person looking at a laptop raising their arms as if frustrated.

Image source: Getty Images.

One of the key factors affecting the guidance is inflation, which is increasing production costs for the company and squeezing margins. But there's also the not-so-subtle fact that Stanley Black & Decker sells many of its tools through hardware stores, which gives it a material amount of exposure to the retail segment of the economy. Consumers tend to pull back spending more quickly than businesses, leading to swift downside earnings risk in the face of economic weakness. This is pretty much what's happening today. But consumers also tend to shift back into buying mode more quickly when things turn around, so there's material potential for a swift upside move when the economy strengthens again.

Here's the thing: You can't build things without tools. So it's not like consumers and businesses can simply stop using Stanley Black & Decker's products. And, as you might expect, management is taking action to deal with the troubles it's facing today, cutting costs and increasing prices. Given that the dividend has been increased annually for over five decades, making the company a Dividend King, it's highly likely that Stanley Black & Decker figures out a way to survive the current headwinds. Meanwhile, new investors can collect a historically high dividend yield of around 4.1%.

Thriving when companies want to save money

Rockwell Automation is very different from Stanley Black & Decker, given that it only serves other companies with complex automation needs. Right now Rockwell Automation is dealing with supply chain issues that have limited its ability to provide the products and services that drive its top line. That's not a good thing, but the headwind is comparatively modest -- management reduced the top side of its full-year 2022 organic sales guidance from 14% to 12% in the third quarter. It kept the low end at 10%. Adjusted earnings guidance was narrowed within the previous range, so that's not really much of a change at all.

And yet investors have punished the stock, which is now off by a third from early-year highs. What's interesting is that Rockwell Automation highlighted its record backlog of work when it reported earnings. That means that it is still seeing solid demand despite the changing economic environment. That shouldn't be too shocking, however, since companies tend to look for ways to save money when times are hard. One way to do that is by reducing staffing levels via automation, which is exactly Rockwell Automation's specialty. Even if there's a short-term hit to earnings here, the long-term is likely to remain very bright. Indeed, when companies ramp up spending coming out of a downturn, automation is likely to be a prime beneficiary. 

The big stock drawdown has pushed the dividend yield up to around 2%. That's actually around middle of the road for Rockwell Automation over the past decade. So it's probably best to see this as paying a fair price for a good company. Indeed, there's a chance that there's more downside to come, but given the corporate focus here, it's probably better to be almost right than miss an opportunity to buy and hold (and hold, and hold) this automation specialist. If you are worried about jumping in too soon, you might consider buying in installments over the next six months to a year. Either way, if you don't act soon you might end up regretting it.

If you snooze you lose

There's never a "best" time to buy a stock since Wall Street is ever-changing and volatile. But given the steep sell-offs in Stanley Black & Decker and Rockwell Automation, investors that don't move past the inertia that fear induces may end up regretting watching and not acting. Simply put, both industrial stocks appear attractively priced right now for investors who prefer the holding period of "forever."