The S&P 500 index is currently 14% off its all-time high. There's no doubt that some stocks trading near 52-week lows will turn out to be stellar performers over the next several years. But picking the wheat from the chaff is often easier said than done. Sometimes the market is right, after all.

However, there is a better way to ensure you don't get stuck with a dog, as Gordon Gekko would say. One method I use to find investment ideas is to look for profitable and growing companies whose share prices are trading at, or near, 52-week highs.

It just makes sense. All the best companies over the last century that created incredible wealth for shareholders were growth stocks that continually hit new highs over many years. It's often better to buy stocks hitting new highs than buy stocks hitting new lows.

Let's look at two fast-growing retailers that are closing in on new highs and still have room to run.

1. Five Below

After slumping in the earlier half of 2022 with the broader market sell-off, shares of Five Below (FIVE -0.55%) have surged and at this writing are only 11.6% off their all-time high. Five Below opened its first store in Philadelphia more than 20 years ago. It's been growing ever since by sourcing quality products on the cheap to sell to kids and teens at value prices. As a discount retailer, Five Below operates at low margins, but its consistent growth has delivered incredible returns for investors.

Over the last decade, revenue and earnings per share grew 22% and 23%, respectively. This fueled a 454% rise in the stock.

Five Below is a proven concept that is on its way to capturing a big opportunity. It has more than 1,300 stores, but management is targeting more than 3,500 over the long term. This should translate to another decade of high, profitable growth on the top and bottom lines. Wall Street analysts currently expect earnings to grow at 24% annually over the next several years. 

The stock looks expensive, trading at a high price-to-earnings ratio of 35. But this is a reasonable valuation for a proven retail growth story with a long runway of growth ahead. Investors should expect the stock to double over the next five years, but holding it for the next 10 years and beyond could deliver even larger gains from here.

2. Ulta Beauty

Another proven, multi-decade growth story in the making is the leading specialty retailer of beauty products. Ulta Beauty (ULTA 0.31%) has been around for more than a few decades. Its wide selection of hundreds of brands continues to win over customers.

Over the last decade, revenue and EPS climbed 16% and 24%, respectively, which drove a return of more than 500%. This is an impressive run despite competition from Amazon, suggesting Ulta has a competitive advantage.

Management attributes its success to a few key factors. One is its omnichannel shopping experience, which includes a growing partnership with Target to offer in-store Ulta Beauty shops to reach more consumers through all price points. Ulta is tapping into mass market appeal and building a large, repeat business with 40 million loyalty members. 

Market estimates by Euromonitor suggest it's just getting started. The beauty products market was estimated at $104 billion last year. Because there isn't a single dominant retailer in this market, Ulta's wide selection, growing store footprint, partnerships, and members program position the business to gain a sizable share of this large opportunity.

Analysts expect EPS to grow 11% per year, which could prove conservative. Either way, the stock could be undervalued, trading at a market average P/E of just 21. The stock returned more than 500% since 2013 and could repeat that performance over the next decade.