The S&P 500 Index closed at a record for the fifth time in six days, as technology shares rallied amid deal activity while corporate earnings spurred optimism that results this season will be sturdy enough to help sustain equities at record levels.

The Dow Jones Industrial Average closed at a record for a fifth straight session. SoftBank Group Corp.’s agreement to buy ARM Holdings Plc for $32 billion pushed semiconductor shares to a 15-year high, and Bank of America Corp. advanced 3.3 percent after posting higher profit in each of its four main businesses. Hasbro Inc. dropped 6.6 percent as sales in its boy-oriented toys disappointed. After the bell, Netflix Inc. tumbled as its quarterly results disappointed.

The S&P 500 added 0.2 percent to 2,166.89 at 4 p.m. in New York amid light trading, following three consecutive weekly gains. The Dow climbed 16.50 points, or 0.1 percent, to 18,533.05 to extend its longest winning streak in four months. The Nasdaq Composite Index surged 0.5 percent, bolstered by chip companies and Apple Inc.’s climb to a seven-week high. About 5.6 billion shares traded hands on U.S. exchanges, 22 percent below the three-month average and the lowest since March 28.

“The focus for the market is on earnings, and more importantly guidance, focusing on the impact of the economy, elections, and how the dollar is influencing business conditions,” said Kevin Kelly, the chief investment officer at Recon Capital Partners in New York. “It’s hard for a market that is preoccupied on management’s every word to be influenced by Turkey.”

Equity futures extended a drop on Friday after news that factions of Turkey’s army tried to overthrow the government of President Recep Tayyip Erdogan, but rebounded after the premier’s supporters put an end to the coup by Saturday.

More than 90 S&P 500 companies report earnings this week. Analysts project a profit decline of 5.8 percent for the index in the second quarter, which would make it a fifth straight drop, the longest streak since 2009. Firms including JPMorgan Chase & Co. and Alcoa Inc. beat earnings estimates last week, sending shares higher.

After Monday’s close, Netflix reported fewer new subscribers than predicted, as higher prices for some older customers spurred an increase in cancellations. The shares dropped 16 percent as of 4:39 p.m. International Business Machines Corp. rose 3.1 percent in after-hours trading as its revenue beat analysts’ estimates.

The S&P 500 recovered all its losses following the U.K.’s vote to leave the European Union and rallied to four consecutive records through Thursday. Signs of strength in the economy combined with speculation the Federal Reserve will hold rates steady this year have helped boost equities from a three-month low on June 27. The main U.S. equity benchmark is up 6 percent this year and on pace for a fifth straight monthly gain, which would be the longest in two years.

Improving Data

While bets for a Fed rate increase crept up amid improving economic reports, traders are still pricing in less than even odds of a move until mid-2017. Meanwhile, a Citigroup gauge that tracks the degree to which data are exceeding economist projections is at an 18-month high. Investors will scrutinize reports on housing starts, existing home sales, manufacturing and jobless claims this week for cues on the vitality of growth. A reading today showedconfidence among homebuilders declined in July from a five-month high.

“The markets look pretty resilient to the events in Turkey and the key is expectations about monetary policies,” said Christian Gattiker, head of research at Julius Baer Group Ltd. in Zurich. “There’s widespread expectation that central banks will stay supportive. Earnings are following the usual ritual in the United States, guiding down and then surprising to the upside.”

In Monday’s trading, the CBOE Volatility Index fell 1.8 percent to 12.44, to an 11-month low. The measure of market turmoil known as the VIX is down about 52 percent from a four-month high on June 24.

Tech Leads

Technology shares led gains among the S&P 500’s 10 main industries, rising to the highest since December 4, while consumer-staples and industrial companies slipped less the 0.2 percent as the worst performers. Retailers paced a climb in consumer-discretionary stocks, and financials rebounded from a decline on Friday, paced by lenders after Bank of America’s results.

Qorvo Inc. and Skyworks Solutions Inc. rose at least 1.9 percent as semiconductor and equipment stocks extended a climb to the highest since February 2001. Hard-drive maker Seagate Technology Plc increased 4.3 percent to a three-month high. Facebook Inc. added 2.2 percent for its best level since May 27.

Coach Inc. gained 2.5 percent, among the strongest in consumer discretionary, after Robert W. Baird & Co. upgraded the shares to the equivalent of buy from hold. Amazon.com Inc. eked out a gain to snap its longest losing streak since March, while Dollar Tree Inc. and Macy’s Inc. increased more than 1.4 percent as retailers in the S&P 500 briefly flirted with an all-time high.

Energy producers nearly wiped out a 0.9 percent dropping, slipping with oil as shipments continued through the vital conduit for oil from Russia and Iraq to the Mediterranean Sea following the failed coup attempt in Turkey. West Texas Intermediate crude futures sank 1.5 percent, after falling as much as 2.4 percent. Apache Corp. and Diamond Offshore Drilling Inc. lost at least 1.3 percent.

Monster Beverage Corp. fell 3.8 percent, the most since February, to weigh on the consumer-staples group. Wells Fargo & Co. analyst Bonnie Herzog downgraded the stock, saying she expects softer results in the near term and a lack of new products.

Merck & Co. declined 1 percent, among the most in the Dow, after BMO Capital Markets Corp. cut the shares to the equivalent of neutral from buy, citing continued pricing pressure.

Among other shares moving on corporate news, GameStop Corp. had its biggest rally since January 2015, rising 7.9 percent, after Chief Executive Officer Paul Raines told CNBC that sales were up 100 percent in 462 stores that are “gyms” in the Pokemon Go app. The retailer is the largest distributor of Pokemon video games and collectibles, he said.