New York - The S&P 500 hovered at five-month highs on Wednesday, 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 $900 billion in market value before retreating.

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

Berkshire Hathaway’s Class B shares rose 3.9 percent 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 <.SPSY> rose 0.81 percent, matching the increase in the industrial sector <.SPLRCI>.

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 percent and boosting other airline stocks. CSX rose 5.1 percent 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 <.SPNY> 1.23 percent drop, as crude prices fell on rising U.S. inventories. [O/R]

At 10:12 a.m. EDT the Dow Jones Industrial Average <.DJI> was up 26.23 points, or 0.10 percent, at 25,146.12, the S&P 500 <.SPX> was down 1.04 points, or 0.04 percent, at 2,808.51 and the Nasdaq Composite <.IXIC> was down 17.46 points, or 0.22 percent, at 7,837.66. Read more at Reuters