It got support early after hedge fund manager David Tepper said that he is still bullish on stocks. Speaking on CNBC before the market opened, Tepper said that investors shouldn't worry about the Fed tapering its stimulus program. The money manager has about $18 billion dollars under management, according to the broadcaster.

The Dow Jones industrial average rose 123.57 points, or 0.8 percent, to 15,215.25. The S&P 500 index rose 16.57 points, or 1 percent, to 1,650.34. Both closed at all-time highs after stalling on Monday.

The Dow has gained for 18 straight Tuesdays. The only day with a longer streak of consecutive gains is Wednesday, with 24 back in 1968, according to Schaeffer's Investment Research.

May has been a strong month for the market. The S&P has risen eight of the past nine days, the Russell and Dow transportation average have risen seven.

The prospect of continued stimulus from the Federal Reserve has also supported the market's run-up.

For stock investors, the U.S. economy is "not too hot, not too cold," said Michael Sheldon, chief market strategist at RDM Financial. It's weak enough that the Fed will continue its $85 billion-a-month economic stimulus program, but strong enough for companies to generate healthy earnings.

"There is a lot of momentum in the market right now," Sheldon said. "It's largely being fueled by the Federal Reserve and modest growth in the U.S."

The U.S. economy grew at an annual rate of 2.5 percent in the first quarter. While hiring has picked up, the unemployment rate is still at 7.5 percent, above the 6.5 percent rate that the Fed is targeting. As a result, the central bank is expected to keep buying bonds to hold down long-term interest rates and encourage more borrowing and spending.

Earnings of companies in the S&P 500 index, meanwhile, increased about 5 percent in the first quarter, and are expected to grow even faster in the second half of the year, according to S&P Capital IQ.

If you liked this article you might like

What's Behind the Surge in Energy Stocks

Hillary Clinton Says Prosecuting Individuals is Key to Wall Street Reform