The Dow is hovering at record highs ahead of tech earnings, while Tesla and energy stocks climb.

On Monday morning, U.S. stocks swung back and churned between gains and losses as investors prepared for a huge week of earnings from heavyweight tech companies.

The Dow Jones Industrial Average gained 35 points, or 0.1%, while the S&P 500 gained 0.1%. The Nasdaq Composite, which is heavily weighted in technology, rose 0.3 percent, boosted by Tesla.

On the heels of strong corporate earnings, Wall Street had a good week. Last week, the blue-chip Dow gained more than 1%, closing at a new high on Friday. Last week, the S&P 500 gained 1.7 percent, marking its third consecutive positive week and an all-time high on Friday.

Facebook, Alphabet, Microsoft, Amazon, and Apple are among the major technology companies set to report results this week. Caterpillar, Coca-Cola, Boeing, and McDonald's are among the Dow businesses slated to report quarterly results this week.

Dow-components In early trade, Apple and Microsoft both fell. Following the release of new whistleblower documents, Facebook's stock was under pressure.

Tesla stock jumped more than 4% after Morgan Stanley raised its price objective to $1,200 from $900 after the company reported record revenue and profitability last week. Hertz, a car rental firm, has recently stated that it will purchase 100,000 Tesla vehicles.

West Texas Intermediate crude futures hit $85 per barrel, sending energy equities higher. Exxon Mobil and Diamondback Energy both saw their stock prices rise by more than 1%.

84 percent of the 117 businesses in the S&P 500 that have declared earnings to date have exceeded forecasts, according to Refinitiv. Profit growth for S&P 500 firms is estimated to be about 35% in the third quarter.

"The rising tide of earnings is lifting all boats and adding gasoline to the bull market fire," said Commonwealth Financial Network's global investment strategist, Anu Gaggar. "Despite concerns about supply bottlenecks and labour shortages, the third-quarter results season is off to a promising start."

All of the major averages have made substantial advances in October. The Dow and S&P 500 are both up more than 5% this month, while the Nasdaq Composite is up 4.4 percent.

The energy sector, which is up 11% this month, has led the October rise in the broader market. Over the same time span, industrials, real estate, materials, and financials have all risen by at least 7%.

"Transports, consumer discretionary, and large-cap tech have driven the market higher over the last two weeks," said Lindsey Bell, chief investment strategist at Ally Invest.