NEW YORK (Reuters) - U.S. stocks edged higher on Monday, led by gains in technology stocks as investors were optimistic ahead of earnings.

FILE PHOTO - Traders work on the floor of the New York Stock Exchange (NYSE) in New York, U.S., July 5, 2017. REUTERS/Brendan McDermid

The S&P 500 technology index .SPLRCT was up 0.8 percent, followed by a 0.6 percent gain in the materials index .SPLRCM.

Technology is expected to have had among the strongest earnings growth for the second quarter, according to Thomson Reuters data.

“You had a little bit of a sell-off in the tech sector over the last couple of weeks,” said Jeff Carbone, managing partner at Cornerstone Financial Partners. “This shows that investors may be seeing opportunities to get in ... as we head into earnings season.”

U.S. companies have begun to release second-quarter earnings, with reports due this week from big U.S. banks including JPMorgan Chase JPM.N, Wells Fargo WFC.N and Citigroup C.N. S&P 500 earnings are forecast up 7.9 percent in the second quarter compared with a year ago.

In a significant victory for the banking industry, the Federal Reserve late last month approved plans from the 34 largest U.S. banks to use extra capital for stock buybacks, dividends and other purposes.

The healthcare sector .SPXHC was down 0.3 percent as investors waited for clarity on the healthcare legislation overhaul proposed in Washington.

The Dow Jones Industrial Average .DJI fell 5.82 points, or 0.03 percent, to end at 21,408.52, the S&P 500 .SPX gained 2.25 points, or 0.09 percent, to 2,427.43 and the Nasdaq Composite .IXIC added 23.31 points, or 0.38 percent, to 6,176.39.

Snap SNAP.N shares fell below their IPO price of $17 for the first time, to hit a low of $16.95. The stock closed at $16.99, down 1.1 percent. Snap was the hottest U.S. technology listing in years when it went public in March.

Fed Chair Janet Yellen’s semi-annual testimony may be the highlight this week for investors looking for cues on further interest rate hikes. She will testify on Wednesday and Thursday.

Amazon.com Inc AMZN.O shares rose 1.8 percent to $996.47 ahead of its popular Prime Day shopping festival. Shares of Best Buy BBY.N fell 6.3 percent to $54.23 on news that Amazon was planning to roll out a Geek Squad competitor.

Advancing issues outnumbered declining ones on the NYSE by a 1.05-to-1 ratio; on Nasdaq, a 1.48-to-1 ratio favored decliners.

The S&P 500 posted 27 new 52-week highs and 11 new lows; the Nasdaq Composite recorded 81 new highs and 69 new lows.

Volume was light, with about 5.6 billion shares changing hands on U.S. exchanges. That compares with the 6.9 billion daily average for the past 20 trading days, according to Thomson Reuters data.