NEW YORK (TheStreet) -- Stocks had closing highs in sight by the final hour of trading Thursday as Wall Street was feeling optimistic as the dollar weakened, Treasury yields stabilized and tech and materials stocks rallied.

The S&P 500 was up 1% to 2,119, above a record closing level of 2,117 on April 24. The Nasdaq climbed 1.3%. The Dow Jones Industrial Average added 1%, situating it around 40 points off its intraday high. 

High-momentum tech stocks including Apple (AAPL), Microsoft (MSFT) and Amazon (AMZN) rose, while the Technology SPDR ETF (XLK) added 1.5%.

Materials stocks gained as crude oil stabilized around $60 a barrel. BHP Billiton (BHP), Rio Tinto (RIO), and Vale SA (VALE) were each higher. The Materials Select Sector SPDR ETF (XLB) gained 1%.

The U.S. dollar fell 0.24% against the euro, 0.1% against the British pound, and 0.33% against the Swiss franc. The greenback hit 11-year highs earlier this year which proved troublesome for many multinationals' top-lines during the first quarter.

U.S. Treasury yields stabilized on Thursday, falling back from five-month highs seen earlier this week. The yield on the 10-year Treasury fell to 2.24%.

"We have dollar weakness today. That continues to hold the key," Peter Cardillo, chief market economist at Rockwell Global Capital, told CNBC. "There is complacency in the bond market and that's helping to ease that fear of yields climbing."

If you liked this article you might like

Amazon Teams With Food Delivery Service to Launch Amazon Restaurants

Is Jollibee About to Bite Off Sandwich Maker Pret A Manger in Record Deal?

Is Jollibee About to Bite Off Sandwich Maker Pret A Manger in Record Deal?

Eating McDonald's Stock Might Make You Sick