Stocks enjoyed a strong open on Tuesday morning and climbed through almost the entire session to end with solid gains. By the closing bell, the Dow Jones Industrial Average (^DJI 0.32%) added 212 points, or 1.2%, and the S&P 500 (^GSPC 1.08%) gained 28 points, or 1.4% on the day:

^DJI Chart

^DJI data by YCharts.

In economic news, new home sales rose at a much faster rate than expected, spiking 17% higher last month, according to the latest official statistics. That marked the best month in eight years for the market even as average housing prices touched a record high of $321,000. 

Many stocks sat out Tuesday's strong rally, though. Retailers Best Buy (BBY 0.41%) and DSW (DBI 2.06%) each fell sharply as Wall Street reacted to their latest operating trends.

Best Buy's electronics struggles

Best Buy was the biggest decliner on the S&P, falling 7% after announcing first-quarter results. Comparable-store sales came in flat, and overall revenue fell by 1%, which matched consensus estimates. Yet the retailer managed to beat expectations on the bottom line as cost cuts helped power a healthy boost in profitability. Gross profit ticked up to 25% of sales, and operating margin jumped to 4% of sales from 1%. Best Buy enjoyed strong demand in its online business and in the wearables, home theater, and appliance product lines. Growth in those areas of the store was completely offset by lower mobile phone and tablet sales, though. 

Stressing the above-plan result, CEO Hubert Joly said the executive team was pleased with the operating performance. "Our teams delivered a strong first quarter, with better-than-expected revenue, improved profitability and progress against our fiscal 2017 initiatives," Joly said in a press release. Those initiatives include cost cuts, market share growth, and customer experience upgrades.

Despite the solid first quarter, Best Buy left its full-year guidance in place, meaning the company still expects flat overall sales. The second quarter should be its weakest period of the year, executives said, before a rebound projected for the fall and winter. Investors didn't like the extra risk placed on this year's holiday season though, and sent the stock lower as a result.

DSW's lowered outlook

Footwear specialist DSW fell 12% after posting weak first-quarter results and slicing its profit outlook for the year. Sales ticked up by 4%, but only thanks to the recent acquisition of online seller Ebuys. Comparable-store sales declined 2% as customer traffic dipped. That poor result was compounded by the fact that DSW had to increase markdowns to keep inventory moving. Gross profit margin sank by nearly three percentage points to hit 30% of sales. 

Executives telegraphed major strategic changes ahead to deal with what they called a "rapidly changing environment" in their retailing niche. These shifts will likely include a fresh look at spending on categories like online selling, store design, and marketing. The investments DSW has made in these initiatives over the last few years "have driven sales, but we haven't grown our bottom line," CEO Roger Rawlins said in a press release. Thus, the management team is conducting "an assessment of our cost structure to improve earnings and reinforce our competitive position," according to Rawlins.

DSW's updated guidance calls for lower operating expenses, but sales are projected to grow at a slower rate. As a result, earnings should come in at $1.37 per share at the midpoint of guidance, down from the prior forecast of $1.57 per share. With its business trends taking a turn for the worse, it makes sense that the stock would fall as investors digest the lower profit outlook.