(Reuters) - The S&P 500 inched nearer to a record high on Tuesday, lifted by Amazon, Alphabet and Microsoft, and by a strong second-quarter earnings season that fueled optimism about the U.S. economy’s strength.

The S&P 500 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.

“We might hit the record and blow through it. As long as there are still strong earnings and there are no corporate blowups, there’s nothing that says we have to stop. Momentum can go on for a long time,” said Liz Young, senior investment strategist at BNY Mellon Investment Management in New York.

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

“Financials really have been trading a lot with the bond market. To the extent that bond yields go higher, specifically on the 10-year Treasury note you seem to see rallies in financials,” said Chris Zaccarelli, chief investment officer at Independent Advisor Alliance in Charlotte, North Carolina.

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

Google parent 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.com added 0.80 percent. The Internet retail and infrastructure heavyweight provided the greatest lift to the S&P 500, followed by Alphabet and Microsoft.

A trader works on the floor of the New York Stock Exchange shortly after the opening bell in New York, U.S., July 31, 2018. REUTERS/Lucas Jackson

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

A strong earnings season has helped U.S. 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 topped estimates. If the beat 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 Dow Jones Industrial Average rose 0.5 percent to end the day at 25,628.91 points.

The S&P 500 ended the session at 2,858.45, just short of its January record of 2,872.87. The Nasdaq Composite added 0.31 percent to 7,883.66.

The CBOE Volatility Index, Wall Street’s “fear gauge,” dropped to 10.93 points, its lowest 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.

Advancing issues outnumbered declining ones on the NYSE by a 1.20-to-1 ratio; on Nasdaq, a 1.29-to-1 ratio favored advancers.

The S&P 500 posted 31 new 52-week highs and two new lows; the Nasdaq Composite recorded 104 new highs and 70 new lows.

Volume on U.S. exchanges was 6.2 billion shares, compared with the 6.3 billion-share average for the last 20 trading days.