Just before the close, shares of Twitter dropped as much as 24 per cent after its results were published early. The stock closed down 18.2 per cent at $42.27.
IBM shares rose 1.9 per cent to $173.92, giving the Dow its biggest boost. The company hiked its quarterly dividend by 18 per cent, the biggest increase in five years. Shares also closed above their 200-day moving average, a bullish technical signal.
Apple swung between gains and losses a day after reporting results. The stock hit a record high in early trading but shares ended down 1.6 per cent at $130.56, weighing on the Nasdaq.
“There continues to be the bull-bear push, even with the good numbers you saw from Merck,” and other companies, said Michael James, managing director of equity trading at Wedbush Securities.
The Dow Jones industrial average rose 72.17 points, or 0.4 per cent, to 18,110.14, the S&P 500 gained 5.84 points, or 0.28 per cent, to 2,114.76 and the Nasdaq dropped 4.82 points, or 0.1 per cent, to 5,055.42.
Merck jumped five per cent, its biggest percentage increase since January 2014, after reporting better-than-expected results and releasing favorable data late Monday about the safety of its diabetes drug.
Contributing to day's volatility, Iranian Revolutionary Guards forces boarded a Marshall Islands-flagged cargo ship in the Gulf, U.S. officials said. That spurred a brief rally in oil prices.Middle East and support from a weak dollar against expectations that U.S. crude stockpiles have reached record highs.
Iranian forces boarded a Marshall Islands-flagged cargo ship in the Gulf on Tuesday, the Pentagon said, an event which spurred a brief rally in oil prices.
"Tensions are so high in that region with the impending Iran-U.S. nuclear deal that any event implied to be U.S.-linked has an immediate effect on oil prices," said John Kilduff, partner at New York energy hedge fund Again Capital.
Brent crude fell 19 cents in U.S. trading to settle at $64.64 a barrel. U.S. crude settled up 7 cents at $57.06 per barrel.