NEW YORK, July 18 — The S&P 500 hovered at five-month highs today, with gains in financial and industrial stocks due to strong earnings from marquee companies offsetting losses in the technology and energy sectors.

On a day when highly valued tech stocks were one of the biggest drags on the benchmark index, Amazon.com Inc became the second company after Apple to top US$900 billion in market value before retreating.

Morgan Stanley rose 3.3 per cent after its profit topped analysts’ estimates on gains in fixed income and equities trading businesses.

Berkshire Hathaway’s Class B shares rose 3.9 per cent and were the biggest boost to the S&P 500 after the company eliminated a restriction on its ability to buy back its stocks.

The S&P financial sector rose 0.81 per cent, matching the increase in the industrial sector.

Industrials were boosted by earnings beat from United Airlines and railroad CSX Corp, which helped ease concerns about the impact of the trade dispute on domestic hauls.

UAL also raised its 2018 profit forecast, sending its shares up 6.9 per cent and boosting other airline stocks. CSX rose 5.1 per cent and pushed shares of other railroad operators higher.

Larry Kudlow, head of the White House Economic Council and President Donald Trump’s top economic adviser, said China’s President Xi Jinping was “holding up” a deal to resolve a “significant trade dispute” between the two countries.

“The overall driver in the markets today is earnings, as we haven’t heard anything new on trade,” said Art Hogan, chief market strategist at B. Riley FBR in New York.

Eight of the 11 main S&P 500 sectors were lower, led by the energy sector’s 1.23 per cent drop, as crude prices fell on rising US inventories.

At 10:12am EDT the Dow Jones Industrial Average was up 26.23 points, or 0.10 per cent, at 25,146.12, the S&P 500 was down 1.04 points, or 0.04 per cent, at 2,808.51 and the Nasdaq Composite was down 17.46 points, or 0.22 per cent, at 7,837.66.

Weighing on the markets was weakness in technology stocks , with Apple and Microsoft the biggest drags on the S&P and the Nasdaq. The tech sector was down 0.31 per cent and weighed the most on the market.

Declining issues outnumbered advancers for a 1.40-to-1 ratio on the NYSE and for a 1.46-to-1 ratio on the Nasdaq.

The S&P index recorded 21 new 52-week highs and no new lows, while the Nasdaq recorded 51 new highs and 25 new lows. — Reuters