Stocks eke out gains; earnings, home sales weigh

Stocks squeezed out small gains in lackluster trading Monday, with the S&P 500 closing at a new high, but a batch of mixed earnings reports and weaker-than-expected existing home sales weighed on the markets.

(Read more: Four reasons tobelieve in the bull market)

The Dow Jones Industrial Average finished just 1.8 points higher, buoyed by Microsoft and Hewlett-Packard. McDonald's led the blue-chip laggards. The Dow traded in a narrow 60-point range.

The S&P 500 and the Nasdaq also ended in positive territory. The S&P 500 is on pace for its best monthly gain since October 2011.

The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, slid near 12.

Among key S&P sectors, financials led the gainers, while energy dipped.

(Read more: Who needs volume? Stocks are doing fine without it)

"The Fed is done talking until next week and we're going to be subject to earnings reports and talk from Congress this week," said Brian Battle, vice president of trading at Performance Trust Capital Partners. "We could be in a holding pattern if the market can resist a selloff, but to propel higher, we need better fundamentals…we're still running on Fed liquidity and the pullback caused by the tapering talk has been reversed in the last two weeks."

Gold surged to its highest level in nearly a year, piercing a key resistance of $1,322 an ounce, as fears abated that the Federal Reserve will curb monetary easing.

Dow component McDonald's fell after the fast-food giant posted earnings and revenue that disappointed Wall Street expectations, weighed by weak sales in Europe and Asia.

(Read More:McDonald's finance guide 'insulting' to low-wage workers)

More than 20 percent of S&P 500 companies have already reported, with 64 percent topping earnings estimates and 50 percent beating on sales, according to the latest data from Thomson Reuters. If all remaining companies post earnings in line with forecasts, earnings will be up 3.1 percent from last year's second quarter.

Nearly one third of S&P 500 companies due to report results throughout the week in addition to eight Dow components. Apple,Caterpillar, Boeing, Facebook, Qualcomm and are among notable names on tap to report throughout the week.

(Read more: Earnings growth todrive equity markets: Goldman Sachs)

On the economic front, existing home sales in June slipped 1.2 percent in June to an annual rate of 5.08 million, according to the National Association of Realtors, missing expectations for a reading of 5.25 million units. Still, the reading was still the second-highest level of sales since November 2009.

Meanwhile, NAR's chief economist Lawrence Yun warned that while momentum in the housing market appears to be strong, mortgage rates will have a greater impact on sales in the coming months. He also cautioned that the continuing increase in home prices was unsustainable.