Stocks close higher as Street cheers earnings, data; McDonald’s up 3%

U.S. stocks closed about half a percent higher on Wednesday, ending a day of choppy trade as investors weighed mixed earnings and signs of strength in the housing market. ( Tweet This )

"I think its a combination of the housing data better than expected and earnings better than expected," said Peter Cardillo, chief market economist at Rockwell Global Capital. "I think it's (also) a combination of the fact that the market couldn't move any lower."

The Nasdaq was within 15 points of its all-time closing high of 5,048.62. The Dow Jones industrial average held above 18,000 and briefly added 100 points in the last 40 minutes before the close. The S&P 500 was within 15 points of its all-time intraday high.

Earlier, stocks fluctuated around the flat line with the Nasdaq underperforming the major averages.

"I would say it's pretty clear the underlying trends are pretty mixed and I think that is leading the Fed to back away from (the idea that) something will happen in June," said Maris Ogg, president at Tower Bridge Advisors. "Trends have gotten a lot more mixed beyond currency. At some point earnings are going to have to catch up with stock prices."

Shares of Visa and MasterCard closed up about 4 percent after jumping by as much as 7 percent and 5 percent, respectively, in high-volume trade following China's announcement that the country will open its market for clearing domestic bank card transactions. The move should allow foreign players such as the two card companies direct access to a market valued at $6.84 trillion last year.

"The hope here is that they can get even a small part of what is a big and growing pie," said Greg McBride, chief financial analyst at Bankrate.com. "More and more people (in China) are moving to urban areas and moving away from cash to things like debit and credit cards."

Stocks opened higher and futures turned higher in the half hour before the open following results from blue-chips Coca-Cola, McDonald's, Boeing.

Read MoreTHIS could spark a 'panic' Fed tightening: Paulsen

"I think we've done enough disseminating of the earnings news here. I think we have a path of least resistance to the upside today," Art Hogan, chief market strategist at Wunderlich Securities, said of the higher futures.

Coca-Cola closed up 1.3 percent after reporting an adjusted 48 cents per share for the first quarter, six cents above estimates, with revenue also above forecasts. Global case volume did fall short of estimates, although the company delivered a better-than-expected quarter in the European market.

"The nice thing, Coca-Cola was better-than-expected. More important their revenue was better-than-expected, which I think that is a really good sign for multinationals," said JJ Kinahan, chief strategist at TD Ameritrade.

"What I"m hoping is some of the tech stocks are able to break through that pattern (of earnings beat, revenue miss on the strong dollar) because their products are hard to replicate," he said, referring to software firms such as Microsoft that reports after the bell tomorrow.

McDonald's closed up 3.13 percent after spiking more than 4.5 percent in early trade as investors cheered a turnaround plan expected on May 4. However, the fast food chain's earnings missed on both the top and bottom lines

Boeing closed down 1.4 percent after earlier falling more than 2 percent after reporting earnings of $1.97 per share for the first quarter, above estimates of $1.81. Revenue was slightly shy of forecasts, but the company reaffirmed its full year guidance for both earnings and revenue. Boeing also delivered 184 commercial jets compared to 161 in the year ago quarter, and also met its goal of delivering 30 787 jets during the quarter.

The housing market was also in focus, with three data reports on the sector out on Wednesday.

In an encouraging sign that the housing market is picking up, total mortgage application volume rose 2.3 percent week to week on a seasonally adjusted basis for the week ending April 17th, according to the Mortgage Bankers Association (MBA).

The FHFA house price index for February showing a 0.7 percent increase from the previous month. Analysts polled by Reuters expected a 0.3 percent gain.

Existing home sales data for March beat expectations at 5.19 million. The report was expected to show a second consecutive monthly increase, to just over 5 million, broadly matching the average monthly reading since last summer.

"Bottom line, today's figure is somewhat old news as contracts were signed months ago and doesn't reflect on the very important spring selling season but as seen in today's MBA data, the spring has started off pretty well (relatively speaking)," Peter Boockvar, chief market analyst at The Lindsey Group, said in a note. "The market's reaction is most noticeable in U.S. Treasurys where the 10-year yield is quietly at a 4-week high."

The U.S. 10-year Treasury yield gained more than five basis points to 1.98 percent following the housing data.

"The early down trade was about Greece, the rest of it came from stronger than expected housing numbers which have traders speculating again about Fed action," said Kevin Giddis, head of fixed income capital markets at Raymond James.

New home sales data on Thursday will shed further light on the housing market.

"Existing home sales don't drive growth," said Jack Ablin, chief investment officer at BMO Private Bank, noting that those sales only benefit realtors or home renovation firms. "It's new home sales that drive growth."

Symbol
Name
Price
 
Change
%Change
DJIA
---
S&P 500
---
NASDAQ
---

The Dow Jones Industrial Average closed up 88.68 points, or 0.49 percent, at 18,038.27, with Visa and McDonald's the greatest advancers and Boeing the greatest laggard.

The S&P 500 closed up 10.67 points, or 0.51 percent, at 2,107.96, with information technology leading all 10 sectors higher.

The Nasdaq closed up 21.07 points, or 0.42 percent, at 5,035.17.

For every three advancers about two declined on the New York Stock Exchange, with an exchange volume of 743 million and a composite volume of 3.3 billion in the close.

The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, traded just below 13.

Read MoreThis country wants to be the next oil-boom shocker

Gold futures settled down $16.20 at $1,186.90 an ounce.

Crude oil futures for June delivery settled down 0.8 percent at $56.16 a barrel on the New York Mercantile Exchange.

Earlier, oil prices rose after a government report showed U.S. commercial crude inventories increased more than expected, but stocks at the delivery point for the West Texas Intermediate contract in Cushing, Oklahoma jumped by fewer than a million barrels.

The U.S. dollar traded flat, with the euro near $1.07.

U.S. stocks closed mixed on Tuesday, mostly failing to hold momentum from Monday, as investors reacted to earnings reports. The trend of earnings beats and revenue misses continued after the close, with Chipotle and Yum among those falling short.

Read MoreEarly movers: BA, KO, TMO, NLSN, AN & more

European stocks turned lower on Wednesday, as investors digested a slew of earnings from European companies. Asian equities continued to rally, with the Shanghai Composite setting a new seven-year high and the Nikkei back above the psychologically key level of 20,000 for the first time in 15 years.

CNBC's Katie Little and Peter Schacknow contributed to this report

On tap this week:

Wednesday

Earnings: AT&T, eBay, Facebook, Petrobras, Qualcomm, F5 Networks, Texas Instruments, Weatherford Intl.

Thursday

Earnings: 3M, Amazon.com, Google, Microsoft, Altria, Caterpillar, Dow Chemical, General Motors, Pepsico,Procter and Gamble, Novartis, Eli Lilly, Union Pacific, Hershey, Freeport-McMoRan, KKR, Domino's Pizza,Johnson Controls, PulteGroup, Dunkin Brands, Raytheon,Starbucks, Capital One, Juniper Networks, Newmont Mining,Southwest Airlines, Pandora

8:30 am: Initial claims

9:45 am: Manufacturing PMI

10:00 am: New home sales

Friday

Earnings: Biogen, AstraZeneca, American Airlines Group, Cabot Oil and Gas, State Street, Xerox, A.O. Smith, Tyco

8:30 am: Durable goods

More From CNBC.com: