By Sue Chang, MarketWatch , Ryan Vlastelica

J.P. Morgan, Wells Fargo, Bank of America all gain after results

U.S. stocks rose moderately on Friday after quarterly earnings from some of the country's biggest banks reassured investors that the financial sector's recent rally was justified. However, the Dow Jones Industrial Average struggled ahead of the long holiday weekend.

Markets have been in an uptrend since November's presidential election, with the bulk of the gains ( coming from the financial sector, as investors have bet banks would benefit from deregulation under President-elect Donald Trump'sincoming administration and an environment that is expected to see rising interest rates.

The strength of the rally--the financial sector is up nearly 20% since the election--could have left stocks vulnerable if the quarterly results disappointed.

See also: 'Bearish divergence' warns it isn't safe to buy bank stocks (

The S&P 500 added 3 points, or 0.2%, to 2,274 and the Nasdaq Composite Index climbed 25 points, or 0.5%, to 5,573.

The Dow Jones Industrial Average slipped 14 points to 19,877, moving within a roughly 100-point range all session.

"The DJIA has been trading in a narrow range and slightly below the previous close. While component banks are trading higher, their advance has so far proven to be insufficient to drive the index higher," said Eric Wiegand, senior portfolio manager of the Private Client Reserve, U.S. Bank.The Dow and the S&P 500 are poised for weekly losses while the Nasdaq is up nearly 1% for the week. U.S. financial markets will be closed Monday for Martin Luther King Jr. Day (

Bruce Bittles, chief investment strategist at RW Baird & Co., said the market is still consolidating "Trump gains" from November and December.

It's "difficult to forecast if this is a topping phase or a sidewise movement correction in an ongoing bullish move," he said. "The best assumption is stocks are correcting an overbought [and] overbelieved period that would conclude when sentiment backs away from the excessive optimism seen in several investor surveys."

J.P. Morgan Chase & Co.(JPM) reported earnings and revenue that surged past expectations (, helped by its trading division, while earnings at Bank of America Corp.(BAC) rose 43%. On the downside, Wells Fargo & Co.(WFC) reported weaker-than-expected earnings ( and revenue in its first full quarter of results since its sales-tactics scandal erupted in September.

The Financial Select Sector SPDR ETF (XLF) rose 0.6%, coming off earlier highs. (

The results proved that the sector's postelection rally had been warranted, according to Wayne Kaufman, chief market analyst at Phoenix Financial Services.

"J.P. Morgan had a terrific beat; B. of A., a very nice one," said Kaufman. "You'd have to believe that the economy will be lackluster going forward to think that banks won't do well from here. Their valuations are still good because they have more earnings power than investors are giving them credit for."

( also:Bank ETFs still favored as investors see growth and Trump bump ahead (

In the latest economic data, U.S. retail sales rose 0.6% in December (, less than had been expected, while holiday sales ( were up a better-than-expected 4%. Separately, producer prices were up 0.3% ( while business inventories rose 0.7% (

Check out:

In remarks late Thursday (said%20the%20U.S.%20economy%20faces%20no%20serious%20short-term%20obstacles), Fed chief Janet Yellen reiterated her support for existing regulations on banks and said the U.S. economy faces no serious short-term obstacles.

In overseas economic news, data showed that China's exports last month fell ( by 6.1%, more than expected.

Corporate movers: Car maker Fiat Chrysler Automobiles NV (FCA.MI) (FCA.MI) was in focus as its stock rebounded in European trading, but its U.S.-listed shares were down in premarket action. Fiat fell Thursday after the Environmental Protection Agency alleged the company had used software to cheat on diesel emissions testing (

Other markets:Oil futures (, gold futures and a key dollar index ( were all trading lower. European stocks ( finished higher, and Asian markets closed mixed (

--Victor Reklaitis contributed to this report.

(END) Dow Jones Newswires

January 13, 2017 15:29 ET (20:29 GMT)

Copyright (c) 2017 Dow Jones & Company, Inc.