In afternoon trading Tuesday, the Dow Jones industrial average was up 107 points, or 0.7 percent, to 15,170. The Standard & Poor's 500 index rose 11 points, or 0.7 percent, to 1,682 and the Nasdaq composite rose 19 points, or 0.5 percent, to 3,725.
Crude oil, which closed above $110 a barrel on Friday, lost $2.63, or 2.4 percent, to $106.89 a barrel.
Among the 10 industry groups in the S&P 500, only energy stocks declined. Consumer staples were flat.
Despite the recent gains, Ralph Fogel of Fogel Neale Partners thinks it's about time for a pullback in the market. He noted that it's close to the five-year anniversary of the financial crisis, and the Dow has more than doubled since then.
The years since the crisis brought "almost a straight-up market without a 15 percent correction. That's a pretty neat move," he said. "That doesn't mean you have to have one, but the probability starts to get higher and higher."
"The next significant move isn't up 20" percent, he said. "It's down 20."
The makeup of the Dow got a shakeup on Tuesday. It's dropping Bank of America, Hewlett-Packard, and Alcoa, to be replaced by Goldman Sachs, Nike, and Visa at the start of trading on Sept. 23. The Dow is made up of 30 stocks.
S&P Dow Jones Indices said the change won't disrupt the level of the industrial average. It said it made the change to diversify the sector and industry group representation of the index.
Hewlett-Packard fell 15 cents, or 0.7 percent, to $22.21. Alcoa was flat and Bank of America rose 15 cents, or 1.1 percent, to $14.64.
Visa rose $5.35, or 3 percent, to $183.82; Nike rose $1.06, or 1.6 percnet, to $66.46, and Goldman Sachs rose $5.62, or 3.5 percent, to $165.107.
In other notable moves:
— Microsoft rose 54 cents, or 1.7 percent, to $32.19 on rumors about who might be its next CEO when Steve Ballmer retires next year.
— Urban Outfitters fell $4.12, or almost 10 percent, to $38.60 after saying its third-quarter sales increases are weaker than earlier in the year.
— Netflix jumped $16.31, or 5.5 percent, to $310.40 as it continued to regain investor confidence after gaffes two years earlier that initially drove away subscribers.