U.S. equities closed lower on Tuesday as Wall Street digested better than expected housing data and mixed earnings results from two Dow components while eyeing the the release of the Federal Reserve's minutes. (Tweet This)
"I think the market is getting some mixed messages here," said Art Hogan, chief market strategist at Wunderlich Securities, adding that while housing has improved, consumer spending has shifted in the U.S.
The Dow and the S&P 500 both flirted with gains during the session, but failed to hold their ground in positive territory. The Nasdaq Composite was the greatest laggard as the iShares Nasdaq Biotechnology ETF and shares of Apple both traded down.
U.S. housing starts data for July came in at 1.206 million, above what economists expected and near an eight-year high. June's starts were also revised higher to a 1.20 million-unit rate from the previously reported 1.17 million-unit pace.
Read More Cramer on housing: 'We are so back'
"Bottom line, the nice uptick in single family starts certainly follows the better home builder sentiment we saw from the NAHB as a dearth of inventories is hopefully going to now be met by improved supply. We certainly have a ways to go as at 782k, single family starts are still running 25% below the 30 year average," Peter Boockvar, chief market analyst at The Lindsey Group, said in a note.
The positive data is especially important given the fact that the Federal Reserve is scheduled to release the minutes from its July meeting Wednesday at 2 p.m., said Mark Luschini, chief investment strategist at Janney Montgomery Scott.
"The housing data gives the Fed another piece of ammunition to move [sooner rather than later], and that's certainly weighing on the markets," Luschini said.
"I think the fact that the Fed minutes will be released tomorrow is an important event and investors will certainly key on that tomorrow," said William Lynch, director of investments at Hinsdale Associates.
Wal-Mart reported quarterly earnings that missed analysts' expectations and also cut its full-year guidance, while Home Depot posted better than expected same-store sales. Shares of Wal-Mart closed down 3.37 percent, while Home Depot's stock ended 2.59 percent higher.
"The fact that Wal-Mart lowered its guidance was a real blow to retail earnings," said JJ Kinahan, chief strategist at TD Ameritrade, adding that while Home Depot's earnings were positive, they were also expected as the company's stock has been bolstered by a recovery in the housing sector.
Stocks opened Tuesday trading lower as investor sentiment was weighted down after the Shanghai Composite dropped 6.12 percent and closed at its lowest level since Aug. 7 overnight amid renewed concerns that the Chinese government could further devalue the yuan.
"The volatility of those markets in China has been tremendous," said Nick Raich, CEO at The Earnings Scout.
The People's Bank of China set the Chinese currency's midpoint rate at 6.3966 against the dollar, but the yuan fell against the greenback during Asia trading to about 6.40.
The CSI300 and the Shenzen Composite also fell more than 6 percent.
Wall Street also kept an eye on oil prices as they continued to hover around multi-year lows.
"They're not collapsing, but they're drifting to this $40 price range," said Peter Cardillo, chief market economist at Rockwell Global Capital. "It's an indication that there's no capitulation [in this market]."
U.S. crude futures settled up 75 cents at $42.62 a barrel.
WTI crude oil in the past year
"Supply is at an all-time high," said Randy Frederick, managing director of trading and derivatives at Charles Schwab. "Add to it the higher dollar and it's no surprise that this market is lower."
The dollar index traded higher at 96.97 and is up over 7 percent this year.
In other corporate news, sporting goods retailer Dick's Sporting Goods posted earnings per share that came slightly above expectations, while revenue came in line with Wall Street's estimates. Dick's also raised its full-year guidance.
Urban Outfitters posted quarterly earnings per share of 52 cents, beating estimates by 3 cents. Still, revenue and same-store sales both missed expectations.
Wireless carrier Sprint is doing away with two-year contracts in favor of a business model in which customers lease their phones.
Petrobras may have to pay $1.6 billion or more to settle U.S. probes into a corruption scandal, according to Reuters.
The Dow Jones Industrial Average closed down 33.70 points, or 0.19 percent, at 17,511.40, led lower by Wal-Mart and with Home Depot leading advancers.
The ended down 5.56 points, or 0.26 percent, at 2,096.88, with materials leading nine sectors lower and consumer discretionary the only advancer.
The Nasdaq closed down 32.35 points, or 0.64 percent, at 5,059.35, as biotechnology stocks closed down 0.9 percent and Apple ended down 0.56 percent.
U.S. 10-year Treasury note yields traded higher at about 2.20 percent.
Gold futures settled down $1.50 at $1.116.90 an ounce.
Decliners led advancers 2 to 1 at the New York Stock Exchange, with an exchange volume of 409 million and a composite volume of 2.910 billion at the close.
The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded near 14.
On tap this week:
Earnings: Medtronic, Analog Devices, La-Z-Boy
Earnings: Lowe's, American Eagle Outfitters, Target, Staples, Hormel Foods, L Brands, NetApp, Synopsys
8:30 a.m.: CPI
2:00 p.m.: FOMC minutes
Earnings: Gap, Hewlett-Packard, Salesforce.com, Brocade, Mentor Graphics, Royal Ahold, Buckle, Madison Square Garden, Toro, Intuit
8:30 a.m.: Initial claims
10:00 a.m.: Existing home sales
10:00 a.m.: Philadelphia Fed survey
Earnings: Deere, Foot Locker, Ann
More From CNBC.com:
—CNBC's Peter Schacknow and Reuters contributed to this report.