Tech firms and retailers rise but energy firms and banks fall as stocks close

Stocks closed mixed as technology companies and retailers rose, and the S&P 500 ended at a four-month high.

Twitter climbed 5% on Tuesday and Dollar Tree gained 3%, although energy companies and banks took losses.

A federal judge is expected to rule on whether AT&T can buy Time Warner in a major antitrust trial. AT&T rose 0.5% and Time Warner rose 0.1%.

The S&P 500 rose four points, or 0.2%, to 2,786, the highest close since February 1.

The Dow Jones industrial average slid one point to 25,320. The Nasdaq composite added 43 points, or 0.6%, to a record high of 7,703.