The S&P and Nasdaq hit their highest levels of the year on Tuesday, while the Dow has yet to return to the black for 2009 since the first few days of January.
Scott Jacobson, chief investment strategist at Capstone Sales Advisors in New York, said investors should be careful about expecting that the gains will continue to come.
"It's too late right now to dump all your money into the stock market given where it is," he said.
Investors are likely to remain focused on worrisome factors like unemployment, rising commodity prices and a weakening dollar.
The dollar has fallen steadily since early March as investors' appetite for riskier assets increased. A falling dollar can trigger inflation, and weakens the buying power of American consumers.
Gold and oil resumed their three-month climbs following sharp pullbacks on Wednesday.
Light, sweet crude rose $2.83 to settle at $68.71 a barrel on the New York Mercantile Exchange after climbing as high as $69.56.
In other trading, the Russell 2000 index of smaller companies rose 7.09, or 1.4%, to 529.80.
About three stocks rose for every one that fell on the New York Stock Exchange, where volume came to 868.4 million shares compared with 923.8 million traded at the same time Wednesday.
Bond prices fell. The yield on the benchmark 10-year Treasury note, which moves opposite its price, rose to 3.72% from 3.54%.
Last week, the 10-year yield surged to a six-month high of 3.75% on worries over mounting U.S. debt loads. Rising long-term yields also have investors on edge because rising interest rates on mortgages and other loans could stall an economic recovery.
Overseas, Japan's Nikkei stock average fell 0.8%. Germany's DAX index rose 0.2% while Britain's FTSE 100 and France's CAC-40 each gained less than 0.1%.