The S&P 500 index inched toward a record high on Tuesday, due in part to Amazon, Alphabet and Microsoft, along with a strong second-quarter earnings season that fueled optimism about the economy’s strength.

The S&P 500 index last closed at a record high on Jan. 26, and a new peak would reassure investors who have worried in recent months that almost a decade of gains on Wall Street might be ending. After a 0.28 percent rise on Tuesday, the S&P 500 was up almost 7 percent in 2018.

A sharp rally in tech stocks has already helped the Nasdaq recover much faster than the broader markets from a sell-off in February, hitting a record high late last month.

The financial sector rose 0.48 percent as higher yields on the 10-year Treasury note lifted bank stocks.

The S&P 500 energy index gained 0.72 percent after U.S. sanctions on Iranian goods went into effect, intensifying concerns about supply.

Alphabet rose 1.47 percent and Microsoft moved up 0.69 percent, driving a 0.33 percent gain in the S&P information and technology index. Amazon added 0.80 percent. The Internet retail and infrastructure heavyweight provided the greatest lift to the S&P 500, followed by Alphabet and Microsoft.

Tesla rose 10.99 percent after Elon Musk said he was considering taking the electric car maker private.

A strong earnings season has helped stocks cushion some of the impact from the simmering trade issues.

With the second-quarter reporting season winding down, 79 percent of S&P 500 companies have exceeded estimates. If that rate holds, it will be the highest on record, dating back to the first quarter of 1994, according to Thomson Reuters I/B/E/S.

The CBOE Volatility Index ended the day at 10.93, its lowest point since January.

Broadridge Financial rose 11.16 percent and Mosaic climbed 5 percent after reporting quarterly results.

Walt Disney added 0.53 percent ahead of its results, which were released after markets closed.

Approximately 6.2 billion shares changed hands on the major domestic equity exchanges, as compared to the 6.3 billion share average over the past 20 trading days.