If you're a keen investor sitting on some cash, it can be unsettling to watch the S&P 500 stock market index power to new highs over and over again. However, if you feel like you've missed the train on some of your favorite stocks, remember that it's always best to focus on the long term.

In fact, a recent study by J.P. Morgan revealed that if you only invested when the market made a new all-time high, you would've done better over the long term than if you invested on randomly selected days instead since 1988.

But with that said, there are still some stocks you can pick up for a bargain. Look no further than these three tickers under $50  per share that can really boost your portfolio. 

1. Tenable: A cybersecurity must-have

The corporate sector is on a knife's edge when it comes to cyber-attacks. This year has delivered an endless stream of media headlines highlighting the ability of ransomware to cripple critical infrastructure. 

An IT professional analyzing a laptop while standing in front of a server.

Image source: Getty Images.

Tenable Holdings (TENB -0.57%) is a threat detection expert that implements vulnerability management tools for its corporate customers. The U.S. government maintains a public database of 169,000 common vulnerabilities and exposures, and Tenable has solutions for 65,000 of them -- more than any of its competitors. 

The company's Nessus platform is a programmable freemium solution that's deployed across 30,000 organizations with 2.5 million global downloads. The free version allows users to scan their networks for potential vulnerabilities at a basic level, but for a complete vulnerability management solution, Tenable's paid subscriptions are more suitable. 

Metric

2016

2021 (Estimate)

CAGR

Revenue

$124 million

$530 million

33%

Data source: Tenable. CAGR = compound average growth rate.

Tenable generates strong revenue growth, and the company is buoyed by a steady increase in new customers. In particular, the number of higher-end customers spending $100,000 or more annually grew a robust 30% in the second quarter of 2021. That suggests strong customer confidence in the company's premium security products.

Tenable is only marginally profitable at the moment, but analysts expect earnings growth to accelerate in 2022. The stock trades at 9 times 2021 sales, and you can pick it up now for a 14% discount compared to the beginning of the year. So it could be good timing for a long-term buy ahead of improving profitability.

2. GoPro: A comeback story for the ages

After listing publicly in 2014, GoPro (GPRO 2.78%) stock fell over 90% in the six years that followed. The action camera company teetered on the brink of complete failure, but it has undergone a strategic transformation over the last 18 months, and it's now well and truly back.

Two people holding hands while skydiving against the backdrop of a bright blue sky.

Image source: Getty Images.

Implementing a direct-to-consumer sales channel has been a key component of GoPro's recent success. Using its website, it's able to bypass retailers and sell to the consumer to capture more profit, and this channel now accounts for over 35% of total product sales.

But it has also launched an innovative subscription option for its brand loyalists. These customers pay $49.99 per year for exclusive product discounts, unlimited cloud storage, and damaged camera replacements. GoPro has gained 1.16 million subscribers so far and expects to have 1.7 million by the end of 2021.

This shift is important because subscriptions have a gross margin of up to 80%. The more lucrative product mix has helped GoPro return to profitability. 

Metric

Q2 2020

Q2 2021

Change

Total revenue

$134.2 million

$249.5 million

86%

Subscribers

372,000

1,160,000

211%

Blended gross margin

30.3%

39.8%

950 basis points

Data source: GoPro.

Analysts expect GoPro to deliver $0.76 in earnings per share in 2021, which means the stock trades at a multiple of just 13 times forward earnings. But it looks even cheaper on a price-to-sales basis, as with $1.15 billion in revenue, that multiple is just 1.3 times.

Investors have the opportunity to buy GoPro now near the ground floor of this transformation, and in a few years' time, it could very well be one of the best performers in your portfolio. 

3. Cohu: A key provider to the semiconductor industry

The last stock under $50 per share you should consider is Cohu (COHU -1.14%). The company manufactures specialized semiconductor testing and handling equipment used by some of the world's largest semiconductor producers.

A semiconductor inspector closely examining manufacturing equipment.

Image source: Getty Images.

The world is in the middle of a semiconductor shortage because of COVID-19 supply chain disruptions, combined with surging demand for more advanced chips. The automotive industry is being hit the hardest, as car manufacturers have to delay production since they can't secure the semiconductors they need. This has resulted in near-empty sales lots for car dealerships and rising prices for consumers.

To resolve this, Cohu has pivoted its focus to the automotive segment, which is now its largest division at 18% of total revenue. Cohu's newest Neon high-speed testing and handling units are geared toward the chips used in vehicles, and the company says they've helped to bring in new customers.

Metric

2016

2021 (Estimate)

CAGR

Total revenue

$282 million

$902 million

26%

Data sources: Cohu, Yahoo! Finance.

While Cohu's revenue growth makes it an attractive proposition, its earnings-per-share comeback is a bigger story. The company has made net losses since 2018 as it invested in growing its business, but it's set to deliver $3.05 in 2021 earnings, according to analysts.

That places the stock at a multiple of just 11 times, which looks cheap compared to the iShares Semiconductor ETF at 37 times. 

One Wall Street analyst agrees, predicting the stock could nearly double from here. As the semiconductor shortage continues, Cohu's products are going to be in high demand, which makes it a great bet for your portfolio.