One of the biggest advantages as an individual investor is having a longer investing time frame. If you can think in terms of years or even decades, then you have a great chance to outperform the Wall Street pros, who focus on just the next quarter or the following year.

That long-term approach boosts your odds of beating the market, but it's crucial to pair this thinking with holding many excellent businesses. And ideally, you can snap up these stocks at a discount compared to peers.

These discounts are harder to find in a market like this, given the huge rally in the S&P 500 since early 2023. But deals are still out there. Let's look at a few of the most attractive ones as of early April.

1. Walmart

Walmart (WMT 0.13%) is not an expensive stock. Sure, the retailer is valued at a nearly $500 billion market capitalization, making it easily the biggest player in the industry.

But it books more than $500 billion in annual revenue. In other words, you can buy Walmart for less than 1 times yearly sales, which is a slight discount compared to Target and a huge discount compared to Costco.

You're not giving up exposure to growth by owning Walmart stock. The chain last reported a 6% sales bump for the holiday quarter thanks to strong customer traffic in the core U.S. market, big gains in its international business, and soaring demand for its e-commerce segment.

"Our team delivered a great quarter," CEO Doug McMillon said in a late-February statement.

It's true that Walmart won't thrill shareholders with huge stock price gains since it is such a mature business. But the company has proved it can still outperform expectations while delivering higher cash returns through dividends and stock buybacks. Those factors should support excellent returns for patient investors.

2. McDonald's

It's suddenly not popular to like McDonald's (MCD 0.17%) stock these days. The fast-food chain is barely in positive territory over the past full year, mainly due to worries about slowing growth. But Mickey D's has been here before.

Sure, the chain is seeing falling customer traffic in its core U.S. market. This slump is arriving at the same time that price increases are ending due to slowing inflation.

As a result, management said in a conference call with analysts that comparable-store sales growth is likely to decelerate back toward its prior normal rate of around 3% to 4%. For context, McDonald's grew comps at a blazing 9% last year and by 10% in 2022.

The world's leading fast-food company can do a lot with slower growth, though. Earnings are on pace to jump by double digits this year as operating profit margin moves toward 50% of sales. McDonald's generates impressive cash flow on that sales footprint as well, which means investors can expect to see more dividends and more spending on stock buybacks over the next several years even if growth stays muted.

Of course, the chain isn't resigned to allowing sales trends to stall. Executives are investing aggressively in growth initiatives like menu additions and the popular drive-thru and home-delivery sales channels.

Yet the beauty of investing in McDonald's stock is that you're likely to see acceptable returns even if the fast-food industry goes through a sluggish sales period. The leading competitor in this space can keep investors feeling full through a wide range of selling conditions, and that makes this stock a great choice for patient investors.