Stocks closed mixed on Tuesday, with the Dow Jones Industrial Average and S&P 500 rising higher, while the Nasdaq Composite dipped into the red. Wall Street was encouraged by strong earnings results from Walmart (WMT  ) and Home Depot (HD  ), with both reports showing strong consumer spending despite elevated prices.

Here's how the market settled on Tuesday:

S&P 500 Index (SPY  ): +0.19% or +8.06 points to 4,305.20

Dow Jones Industrial Average (DIA  ): +0.71% or +239.57 points to 34,152.01

Nasdaq Composite Index (QQQ  ): -0.19% or -25.50 points to 13,102.55

Walmart reported quarterly earnings that beat top and bottom line estimates on Tuesday, sending the stock over 6% higher. The retail giant posted revenue of $152.86 billion and adjusted earnings per share of $1.77.

The results follow a recent warnings from Walmart, which lowered its full-year profit forecast, citing reduced consumer discretionary spending as prices rise. On Tuesday, Walmart reaffirmed this profit warning, expecting full year profits to decline between 9% and 11%.

Walmart CEO Doug McMillon said on Tuesday the company is "working hard to support" consumers as they "prioritize" extra spending as food and gas prices impact extra cash.

Home Depot also reported second quarter results that topped Wall Street expectations on Tuesday, posting adjusted earnings per share of $5.05 and record sales of $43.8 billion.

Positive retail data boosted shares of Target (TGT  ), Macy's (M  ), and Best Buy (BBY  ) higher.

Elsewhere for stocks, Bed Bath & Beyond (BBBY  ) continued to surge higher on wild retail trading on Tuesday, closing up more than 29%. Meme stock traders were encouraged on recent news that GameStop (GME  ) Chair Ryan Cohen had place another bet on the struggling retailer.

Airline stocks also outperformed on Tuesday as investors bet on consumer-spending-driven stocks. The U.S. Global Jets ETF (JETS  ) stock closed about 1% higher, while American Airlines (AAL  ), Delta Air Lines (DAL  ) and United Airlines (UAL  ) all climbed higher.

For economic news, U.S. housing starts sharply fell in July by 9.2%, or much more than the 2.1% expected, to a seasonally adjusted rate of 1.446 million units. This is the lowest level for the data since February 2021. Moreover, total building permits issued during the month also fell by 1.3% from the previous month.

Looking ahead, all eyes will be on the Commerce Department's retail sales report for July due out on Wednesday, as well as earnings reports from Target and Lowe's (LOW  ).