With the stock market trading near record highs, finding long-term buys at reasonable prices can be difficult, if only because the risk of overpaying is so high.

In the event of an economic slowdown, you can expect to see falling earnings and falling price-to-earnings ratios. While investors can't really do much about multiple compression, they can look for companies that will continue to increase earnings regardless of the economic environment.

Here are three names that fit that latter category. 

Cell phone tower on a rocky hillside against a bright blue sky with clouds.

Image source: Getty Images.

1. American Tower will benefit from increased mobile data usage

American Tower (NYSE:AMT) is a cellphone tower real estate investment trust (REIT) that benefits from high barriers to entry and a longer-term trend of higher mobile data consumption. The company builds towers and leases out capacity to wireless providers, governments, and cable companies. These leases are longer-term (5-10 years) and usually have automatic annual rent increases built-in. Companies using the towers find switching to different towers is difficult and often results in performance degradation, so they are hesitant to do so. 

The increasing use of mobile data gives the company a long-term growth story. 4G is still growing, and 5G is on the horizon. Mobile data usage has grown by a cumulative annual growth rate of 49% from 2017 through 2021, and it is expected to continue growing going forward. Importantly, demand for data seems to be relatively insensitive to the state of the economy. This gives the company added stability should the U.S. hit a recession over the next few years. Finally, American Tower has increased its dividend every quarter since 2012. 

2. Prologis will benefit from a sea change in corporate inventory management

Prologis (NYSE:PLD) is another stock that benefits from longer-term, persistent trends. This REIT specializes in the logistics space. If you have driven on any major highways close to major cities, you have probably seen massive warehouse facilities with dozens of truck bays. Lately, supply chain issues have been a major news item. When you think of the supply chain, you should think of Prologis. 

Prologis has some of the most attractive real estate adjacent to major U.S. metros. Available land is scarce (and expensive) along major arteries like Interstate 95, which connects many of the population centers from Washington, D.C., to Boston (as well as the Eastern seaboard from Maine to Florida). This makes Prologis's space in high demand. 

One of Prologis's biggest customers is Amazon, which will maintain inventory at these facilities in order to reduce shipping times. Major big-box retailers will also keep inventory at Prologis warehouses in order to ensure adequate supply in all of their stores. One of the biggest takeaways from the COVID-19 pandemic has been that inventories were maintained at too low a level across the board. Companies are going to rethink their inventory policy going forward and will almost certainly build up more. Prologis stock has been on a tear this year, and as long as the inventory build continues (which will probably last years), rents will continue to increase, as will earnings. 

3. Realty Income is the steady performer across the business cycle

Realty Income (NYSE:O) is another REIT that should be a staple of every income investor's portfolio. Realty Income specializes in single-tenant properties, where the tenant is responsible for paying rent, insurance, taxes, and maintenance. These leases are much longer-term than the more typical gross lease, which requires the tenant to pay only rent. Given that these leases are longer-term, only the most creditworthy and stable companies are suitable for this arrangement. 

The typical tenant for Realty Income would be a drug store, convenience store, or a dollar store. These are highly defensive retailers, which are more insulated from the vicissitudes of the economy than discretionary retailers like apparel and electronics. During the COVID-19 pandemic, Realty Income's tenants largely remained open (aside from services like health/fitness and theaters). While many retail REITs were forced to cut their dividends, Realty Income raised its dividend three times in 2020. The company is a Dividend Aristocrat, a select group of S&P 500 companies that have a minimum 25-year track record of instituting dividend increases every year. Realty Income is the sort of stock a dividend investor could build a portfolio around. 

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.