The question of "when" not "if" the next recession will happen in the United States is on investors' minds. Negative-yielding bonds have risen to a whopping $17 trillion, and the S&P 500 is at a historical peak -- rising 22% in 2019 alone and 272% since January 2010.

Trying to time the market is a losing battle. However, investors can lower exposure to volatility ahead of the next recession by investing in companies that have historically withstood the headwinds of a downturn. Three such retailers are AutoZone (AZO 0.03%), Dollar Tree (DLTR 0.04%), and Walmart (WMT -0.08%). Let's take a closer look at why now is a good time to consider investing in these stocks.

A recession ahead road sign

Image source: Getty images.

1. AutoZone 

AutoZone is the largest distributor and retailer of automotive accessories and replacement parts in the United States. Auto sales decreased 35% during the Great Recession -- which proves that consumers will drive vehicles longer as the economy slows, fixing small problems to keep a tight budget.

The "do-it-yourself" consumer is the target customer for AutoZone, which operates locations in the United States, Mexico, and Brazil. During the previous recession, AutoZone was operating 4,417 locations throughout the U.S. and Mexico, with revenue of $6.82 billion in 2009. Revenue projections in August 2019 were $11.86 billion, operating 6,411 locations -- which is an increase of $5.04 billion in annual revenue since 2009.

Beating the S&P 500 during the recession, AutoZone achieved an 11.1% compound annual growth rate (CAGR) from January 2007 to January 2010, while the S&P 500 retracted 7.6% annually during the same period. Expanding after the economic downturn, AutoZone has increased by 1,994 locations, totaling over 6,000 locations in the United States, Mexico, and Brazil.

AutoZone's largest competitor, O'Reilly Automotive (ORLY -0.97%), is on the company's heels. However, AutoZone is showing it is fairly valued with a forward price-to-earnings (P/E) ratio of 17.66 against O'Reilly's 24.67, in addition to a trailing-12-month price-to-sales (P/S) ratio of 2.42, compared to O'Reilly's 3.46. Neither company pays a dividend, but O'Reilly returned a 6.8% CAGR between 2007 and 2010, a 4.3 percentage point lower annual return than AutoZone during the 2008-09 recession.

2. Dollar Tree

After purchasing Family Dollar in 2015 for $8.5 billion, Dollar Tree increased the store base by 8,000 locations -- giving Dollar Tree a total store count of 15,000 for the second quarter of 2019. Operating approximately 3,500 stores in 2009, Dollar Tree's share price grew 16.9% CAGR between 2007 and 2010 -- beating the S&P 500.

Dollar Tree is currently converting the 8,000 Family Dollar locations into Dollar Tree stores, streamlining distribution and giving consumers the successful Dollar Tree pricing model of $1 for everything in the store rather than Family Dollar's pricing, which ranges from $1 and up.

Showing strength in a strong economy, consolidated net sales are expected to total between $23.57 to $23.79 billion for the second quarter, an upward revision from the original low-end estimate of between $23.51 and $23.83 billion. The CEO of Dollar Tree, Gary Philbin, announced in the second quarter that "efforts to improve the consistency of execution across the store base and our acceleration of initiatives to optimize the real estate portfolio are paying off." A planned conversion of 150 Family Dollar stores into Dollar Tree stores in the second quarter shows strength in the acquisition.

If another recession is on the horizon, a discount retailer such as Dollar Tree is attractively priced with a 22.25 forward P/E, compared to its largest competitor, Dollar General (DG -0.41%), at 24.63. In addition, a 1.16 trailing-12-month P/S is a value over Dollar General's P/S of 1.97. Dollar Tree's five-year revenue growth of 23.37% CAGR stands well above Dollar General's 8.04%.

3. Walmart 

Walmart, one of the largest companies in the world, has approximately 2.2 million employees and delivered fiscal 2019 revenue of $514.4 billion. Providing discount merchandise to consumers, the company has an advantage over competitors as low prices are coveted during tough economic times. During the Great Recession, the share price of Walmart had a 4.5% CAGR between January 2007 and January 2010.

One of the largest competitors for Walmart globally is Amazon.com. Walmart leads in physical space, and Amazon dominates in e-commerce.

Walmart is expanding its already impressive e-commerce platform with growth of 37% for the recent second quarter, year over year. The back and forth e-commerce battle between Amazon and Walmart will continue, but Walmart investors receive a 1.78% forward dividend yield while Amazon investors receive no dividend at all.

Fiscal 2020 full-year guidance is anticipated to be better than originally expected, as management is predicting a consolidated operating income from a "low single-digit range" to a "slight increase."

Operating over 11,000 locations across 27 countries, Walmart is diversified, creating a well-protected revenue stream. A forward P/E of 24.13 may seem expensive when compared to Target's 17.77, but Walmart's trailing 12-month P/S of 0.66 is showing value over Target's P/S of 0.74. Competitive pricing, a wide consumer reach, an expanding e-commerce platform, and historically proven growth during recessionary periods make Walmart a recession-resilient retailer.