Stocks rose to new records on Monday with only slight effort as a rally in tech helped to offset weakness in oil and political uncertainty in Turkey.

The S&P 500 was up 0.24%, the Dow Jones Industrial Average gained 0.09%, and the Nasdaq added 0.52%. The Dow eked out a new closing high of 18,533.05, mere points above its previous Friday record, while the S&P 500 scored a new high of 2,166.89.

Stocks have enjoyed a stretch of record-breaking days after a better-than-expected U.S. jobs report for June brought relief over the state of the U.S. economy. A dismal May reading had triggered fears over growth.

"The economic data 'post Brexit' has been generally better than expected and given investors a reason to be aggressively buying stocks," Kingsview Asset Management's Paul Nolte wrote in a note. "The belief in a stronger economic backdrop as we enter the last half of the year is also showing up in stocks. Valuations remain stretched and earnings have not yet improved, but investors are betting they will very soon."

The tech sector was in rally mode as ARM Holdings (ARMH) surged 42% on a buyout offer from SoftBank (SFTBF) . Japan's SoftBank offered a deal worth more than 24.3 billion pounds ($32.1 billion), roughly a 43% premium to ARM's Friday close. The acquisition is the biggest in the U.K. since AB InBev and SABMiller's deal last November.

Other large-cap tech companies were on the upswing including Apple (AAPL) , Alphabet (GOOGL) , Microsoft (MSFT) and Facebook (FB) . The Technology Select Sector SPDR ETF (XLK) rose 0.7%.

Alphabet, Apple and Facebook are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells GOOGL, AAPL or FB? Learn more now.

Investors appeared to shrug off an attempted coup in Turkey over the weekend that resulted in hundreds of deaths. Since then, nearly 8,000 police officers have been suspended on suspicion of having links to the attempt. President Recep Tayyip Erdogan has promised to rid the country of the "virus" that fueled the attempt.

Turkish companies with U.S.-listed shares were plummeting on Monday. Istanbul-based telecom Turkcell Iletisim Hizmetleri (TKC) plummeted more than 5%, bank Akbank (AKBTY) slid 3%, and the iShares MSCI Turkey ETF (TUR) tumbled nearly 7%.

Turmoil in Turkey over the weekend dictated oil's recent moves. West Texas Intermediate crude closed 1.6% lower at $45.24 a barrel on Monday.

"The coup in Turkey, which began on Friday, helped push prices above $48 barrel for a spell," said Daniel Holder, commodity analyst at Schneider Electric. "However, by the end of Saturday forces loyal to ... Erdogan had regained full control. As Turkey has both seaborne and pipe-borne crude oil flow through its territory, the country's stability is important to maintaining Russian and Middle Eastern crude into the Mediterranean region."

The earnings calendar kicked into high gear on Monday in week two of the season. Bank of America (BAC) rose 4% on Monday after exceeding analysts' low-ball estimates in its recent quarter. As expected, a low interest-rate environment continued to eat into profit. The North Carolina bank earned 36 cents a share over the quarter, less than 45 cents in the year-ago period but above estimates of 33 cents. Trading revenue bounced back, climbing 12% to $3.7 billion.

Hasbro (HAS) beat earnings estimates in its recent quarter on strength in demand for its Star Wars and Frozen toys. Its girls toys segment generated a 35% increase in sales, driven by its Disney Princess and Frozen doll lines. Hasbro's Disney license, which it secured in 2014, has proven a boon to its top- and bottom-lines. Overall revenue rose 10%, or 12% excluding currency exchange. The stock fell, however, fell 7%.

Charles Schwab (SCHW)  bested expectations in its second quarter. The financial institution earned 30 cents a share over the quarter, a dime higher than the year-ago period. Revenue rose 17% to $1.83 billion, coming in above forecasts of $1.8 billion.

"As earnings season ramps up, strong results may be needed to keep valuations in check or upside momentum could begin to level off," said Randy Frederick, managing director of trading and derivatives at Charles Schwab. 

More from Markets

Trump Takes Aim at Auto Imports; Markets End Mixed -- ICYMI

Trump Takes Aim at Auto Imports; Markets End Mixed -- ICYMI

Video: What Oprah's Content Partnership With Apple Means for the Rest of Tech

Video: What Oprah's Content Partnership With Apple Means for the Rest of Tech

REPLAY: Jim Cramer on the Markets, Oil, Starbucks, Tesla, Okta and Red Hat

REPLAY: Jim Cramer on the Markets, Oil, Starbucks, Tesla, Okta and Red Hat

Flashback Friday: The Market Movers

Flashback Friday: The Market Movers

OPEC Deal Doesn't Boost Production Enough to Drive Down Crude, Gasoline Prices

OPEC Deal Doesn't Boost Production Enough to Drive Down Crude, Gasoline Prices