US stocks have closed at a record high behind gains for chemical and machinery companies.
Energy companies also rose as the price of oil continued its recent recovery.
Makers of chemicals and mining companies made the biggest gains, and machinery companies and banks followed. Investors sold government bonds and utility and phone companies. Those stocks climbed earlier in the year as investors sought safety.
Stocks have see-sawed between small gains and losses for more than a week as investors consider mixed reports on the health of the economy and a decline in corporate earnings.
"The market has run up in anticipation of better earnings ahead," said Brian Nick, chief investment strategist for TIAA Investments.
"If those earnings don't come, we have the Wile E Coyote moment where we're off the cliff...and we're gonna fall."
The Dow Jones industrial average climbed 59.58 points or 0.3%, to 18,636.05. The Standard & Poor's 500 index rose 6.10 points, or 0.3%, to 2,190.15. The Nasdaq composite added 29.12 points, or 0.6%, to 5,262.02.
Second-quarter earnings are nearly all in the books, with this week's releases from retailers Home Depot, Wal-Mart and Target among the last to appear.
Corporate earnings are down once again this quarter and investors don't expect much growth in the third quarter either, but they are starting to expect improvement after that.
US crude jumped 1.25 dollars, or 2.8%, to 45.74 dollars a barrel in New York. Brent crude, a benchmark used to price international oils, rose 1.38 dollars, or 2.9%, to 48.35 dollars a barrel in London. After a steep slide for most of June and July, the price of US crude gained 6.4% last week.
The dollar fell to 101.25 yen from 101.27 yen and the euro rose to 1.1183 dollars from 1.1164 dollars.
Japan's economy grew at a lower-than-forecast 0.2% pace in the April-June quarter, as private demand and exports remained weak. That could push the Bank of Japan to take additional steps to stimulate the national economy. The bank approved a new stimulus package earlier this month, but that was not enough to please investors.
Germany's DAX was up 0.2% and the CAC 40 of France dipped less than 0.1%. Britain's FTSE 100 gained 0.4%. Japan's Nikkei 225 edged 0.3% and Hong Kong's Hang Seng index rose 0.7%.