NEW YORK (Reuters) - The U.S. benchmark S&P 500 stock index snapped a six-day losing streak on Friday as technology stocks recovered after a week of losses, with investors looking for bargains ahead of the third quarter earnings reporting season.

Even the hard-hit S&P500 energy and financial sectors managed to close the session with slight gains after a late afternoon rally.

The S&P technology index .SPLRCT gained 3.2 percent on the day, showing its strongest one-day gain since March 26, although it still registered its biggest weekly drop since March 23.

“People are starting to buy in, thinking the higher flying growth stocks were oversold. They wanted to get in before next week when earnings start coming,” said Janna Sampson, co-chief investment officer at OakBrook Investments LLC in Lisle, Illinois.

But until the U.S. and China reach a trade deal, the rebound in the stockmarket could be vulnerable as investors are anxious about the impact of tariffs on corporate profits.

“If earnings come out good I think this rally is sustainable if we don’t get negative trade news. Trade news is the wild card. That’s the big if,” said Sampson.

The Dow Jones Industrial Average .DJI rose 287.16 points, or 1.15 percent, to 25,339.99, the S&P 500 .SPX gained 38.76 points, or 1.42 percent, to 2,767.13 and the Nasdaq Composite .IXIC added 167.83 points, or 2.29 percent, to 7,496.89.

The technology sector's biggest boosts were Apple AAPL.O, and Microsoft MSFT.O which rose more than 3.0 percent. Visa V.N and Mastercard MA.N both climbed almost 5.0 percent, boosted by strong credit card sales included in bank earnings reports, according to Oakbook's Sampson.

The S&P500's financial sector ended the day up 0.1 percent and the S&P 500 banks subsector .SPXBK closed down 0.4 percent, well above its session low. The biggest drag on the subsector was JPMorgan Chase & Co JPM.N, which closed down 1.0 percent despite reporting a quarterly profit that beat expectations.

PNC Financial PNC.N led the percentage losers among bank stocks, with a 5.6 percent drop after the regional bank reported disappointing quarterly loan growth and said it expected only a small improvement in lending this quarter.

The three gainers among banks included Citigroup C.N, which rose 2.0 percent, and Wells Fargo WFC.N, which eked out a 1.3 percent gain after upbeat results.

Netflix NFLX.O and Amazon AMZN.O, some of the names that took a big hits in the week's selloff, rose 5.7 percent and 4.0 percent respectively.

The bank results launch a quarterly reporting season that will give the clearest picture yet of the impact on profits from President Donald Trump’s trade war with China.

Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., October 12, 2018. REUTERS/Brendan McDermid

Earnings at S&P 500 companies are estimated to have risen 21.5 percent in the third quarter, according to I/B/E/S data from Refinitiv, a slowdown from the previous two quarters.

Energy stocks .SPNY ended the day up 0.3 percent as oil prices steadied to settle up slightly after a volatile session dropped on a weakening oil demand outlook. [O/R]

The consumer discretionary .SPLRCD and communication services .SPLRCL sectors, both rose more than 2.0 percent.

Advancing issues outnumbered declining ones on the NYSE by a 1.38-to-1 ratio; on Nasdaq, a 1.51-to-1 ratio favored advancers.

The S&P 500 index posted no new 52-week highs and 52 new lows; the Nasdaq Composite recorded 10 new highs and 234 new lows.

Volume on U.S. exchanges was 8.91 billion shares, well above the 7.78 billion average for the last 20 trading days but below the soaring volume of Thursday’s and Wednesday’s sessions.

(This version of the story was refiled to fix typos)