What happened

Shares in Cognex (NASDAQ:CGNX) rose by 30.8% in April, according to data provided by S&P Global Market Intelligence. The moves come down to the market taking a more positive viewpoint on the economy in 2020.

Cognex tends to derive around half of its sales from the automotive and consumer electronics markets, and unfortunately those weren't great markets to be in in 2019. Declining light-vehicle sales/production and smartphone sales put a hold on capital spending plans in both industries in 2019 -- bad news for Cognex. For reference, the company's machine vision systems help manufacturers and logistics companies monitor, control, and guide automated processes like car production or smartphone manufacturing.

Smartphones on sale

Cognex's machine vision systems help eliminate defects in smartphone production. Image source: Getty Images.

Going into 2020, the hope was that global light-vehicle sales/production would increase and 5G roll-outs would spur smartphone sales. Of course, the COVID-19 pandemic has now nixed that idea, but if investors are starting to feel more optimistic about a recovery in the economy after the pandemic has been contained, then it's likely that a stock like Cognex will be seen as a key winner.

So what

Cognex recently reported earnings, and its clear from management's commentary that the consumer electronics market is likely to come back quicker than the automotive one will. Meanwhile, the logistics market -- largely tied to e-commerce warehousing -- remains in growth mode for the company. Moreover, thinking longer-term, there's a growth opportunity in the potential for increased automotive spending on electric vehicles.

Now what

Cognex usually gets its big orders in its second and third quarters -- often so that its customers can gear up for a production ramp-up in the fourth quarter. Given the current environment, it's hard to see the company winning significant orders in the second-quarter. Yet with most economists predicting an economic recovery to begin in the third quarter, it will be interesting to see if Cognex starts to see some consumer electronics orders kick in.

However, the indication from Cognex management is that it could be a while before meaningful automotive orders start flowing in. As such, investors need to keep a eye out for the smartphone market while hoping that global light-vehicle sales start to stabilize at some point this year.