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 (http://www.marketwatch.com/story/stock-markets-trump-rally-is-mostly-a-bank-rally-2016-11-17) 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 (http://www.marketwatch.com/story/bearish-divergence-warns-it-isnt-safe-to-buy-bank-stocks-2017-01-13)

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 (http://www.marketwatch.com/story/which-us-markets-are-closed-for-martin-luther-king-jr-day-2017-01-12).

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 (http://www.marketwatch.com/story/jp-morgan-reports-better-than-expected-earnings-2017-01-13), 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 (http://www.marketwatch.com/story/wells-fargo-profit-falls-revenue-misses-estimate-2017-01-13) 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. (http://www.marketwatch.com/story/financial-etf-nears-highest-level-since-2008-after-bullish-bank-results-2017-01-13)

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."

(http://www.marketwatch.com/story/what-to-expect-from-wells-fargo-earnings-impact-of-sales-tactics-scandal-2017-01-12)See also:Bank ETFs still favored as investors see growth and Trump bump ahead (http://www.marketwatch.com/story/bank-etfs-still-favored-as-investors-see-growth-and-trump-bump-ahead-2017-01-11)

In the latest economic data, U.S. retail sales rose 0.6% in December (http://www.marketwatch.com/story/retail-sales-climb-06-in-december-2017-01-13), less than had been expected, while holiday sales (http://www.marketwatch.com/story/holiday-retail-sales-rise-4-to-beat-nrf-expectations-2017-01-13) were up a better-than-expected 4%. Separately, producer prices were up 0.3% (http://www.marketwatch.com/story/producer-prices-jump-along-with-energy-costs-2017-01-13) while business inventories rose 0.7% (http://www.marketwatch.com/story/business-inventories-surge-in-november-2017-01-13).

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 (http://www.marketwatch.com/story/chinas-exports-fall-2-in-2016-extending-decline-2017-01-13) 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 (http://www.marketwatch.com/story/fiat-chryslers-stock-plunges-epa-issues-notice-of-violation-2017-01-12).

Other markets:Oil futures (http://www.marketwatch.com/story/oil-higher-after-saudi-arabia-cuts-output-china-imports-rise-2017-01-13), gold futures and a key dollar index (http://www.marketwatch.com/story/dollar-recaptures-lost-ground-after-losses-linked-to-trump-conference-2017-01-13) were all trading lower. European stocks (http://www.marketwatch.com/story/fiat-rebound-sends-european-stocks-higher-into-the-weekend-2017-01-13) finished higher, and Asian markets closed mixed (http://www.marketwatch.com/story/asian-markets-largely-retreat-on-profit-taking-2017-01-12).

--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.