NEW YORK (AP) -- It was a stock market squeaker.
After piercing its all-time high in early trading, then yo-yoing below and above that level several times during the day, the Standard and Poor's 500 index on Wednesday managed to eke out a record at the close, besting the old one by just two-hundredths of a point.
Financial and technology companies had some of the biggest gains. Bank stocks rose after Bank of America reported that its profit surged to $3.44 billion in the fourth quarter. Apple was up nearly 2 percent.
Investors have been worried stocks would stall in the new year after a surge of nearly 30 percent in the S&P 500 last year. The first few trading days in 2014 seemed to confirm their fears. As of the close of trading Monday, the S&P 500 was down 1.6 percent.
But a combination of positive economic reports and strong earnings on Wednesday sent all three major indexes higher.
The S&P 500 gained 9.50 points, or 0.52 percent, to 1,848.38. The last closing high was 1,848.36 on Dec. 31, 2013. With Wednesday's rise, the index is now basically flat for the year. In 2013 the S&P 500 closed at record highs 45 times.
The Dow Jones industrial average closed up 108.08 points, or 0.7 percent, to 16,481.94. It is 94.72 points from its closing high, just one good up day away. The Nasdaq composite rose 31.87 points, or 0.76 percent, to 4,214.88. The tech-heavy index is still 16 percent below its high during the dot-com bubble more than a decade ago.
Bank of America climbed 2.3 percent after it reported a jump in earnings. The loans on its balance sheet continue to improve, and the bank's provision for credit losses fell to $336 million, from $2.2 billion in the same period a year earlier. Even its mortgage division, which took huge losses after the housing bubble popped, improved.
Apple rose 2 percent, and Microsoft by 2.7 percent. Apple CEO Tim Cook said the company had sold a record number of iPhones in China, Taiwan and Hong Kong in the last three months of 2013. On Friday, Apple plans to start selling its iPhone in China through China Mobile, the world's largest cellphone carrier.
Seven of the 10 industries in the S&P 500 closed higher, led by telecommunications, information technology and financial services. The three were each up more than 1 percent.
Whether stocks can climb more in the coming days depends partly on corporate earnings reports now coming out for the fourth quarter of last year. Companies reporting on Thursday include Goldman Sachs, Citigroup, American Express and Intel.
After years of squeezing more and more profit out of every dollar of revenue, companies will have to lift that top line to hit their earnings targets for this year, said Joseph S. Tanious, global market strategist at JPMorgan. But he's optimistic. "You will see strong revenue growth," he said.
Tanious said a 4 percent to 6 percent increase in S&P 500 earnings per share this year shouldn't be "too difficult."
Financial analysts expect S&P 500 earnings per share to increase 5.6 percent for the fourth quarter, and 9.8 percent for all four quarters of the new year, according to S&P Capital IQ. Revenue growth for both periods is expected to be half the earnings growth.
Stocks were also pushed higher Wednesday by some encouraging economic reports.
A survey by the New York branch of the Federal Reserve found that manufacturing conditions in the region were improving.
A separate report from the Federal Reserve found that economic growth remained healthy in most regions of the country, helping bolster the belief that economic growth will pick up in the coming months. The report followed one on Tuesday showing strong retail sales during the holiday season.
Two so-called safe-have assets fell on the positive economic news. Bond prices fell, pushing the yield on the 10-year Treasury note up to 2.89 percent from 2.87 percent on Tuesday. Gold fell $7.10, or 0.6 percent, to $1,238.30 an ounce
In other news, U.S. wholesale prices increased in December, as gasoline prices rose along with other energy costs. Overall inflation remained mild. The Labor Department said the producer price index, which measures costs before they reach the consumer, rose 0.4 percent last month.
Other stocks that had big moves:
— Netflix, the movie-streaming service, fell more than 2 percent to $330.38 out of concern that the company may someday have to pay broadband providers for its subscribers' heavy use of data. A court ruling this week gave broadband access providers such as Comcast, Time Warner Cable and Verizon more flexibility to charge big bandwidth users higher prices. Investors also worried that Netflix might pass along any new costs to subscribers in the form of higher fees.
— Fastenal, an industrial supply company, dropped the most in the S&P 500, down 4.5 percent, after reporting that it missed fourth-quarter earnings by a penny. The stock slumped $2.15 to $46.06.
— Shares of 3-D printer company ExOne fell $5.41, or 9 percent, to $56.85 after cutting its revenue forecast for the year. The North Huntington, Pa., company cited deferred orders from international customers.