The Nasdaq composite index notched its fourth record-high close in a row Tuesday, eking out a modest gain on a day when the other major U.S. stock indexes barely budged.

After wavering between small gains and losses for much of the day, the Standard & Poor’s 500 index closed unchanged, while the Dow Jones industrial average posted a slight loss. More stocks rose than fell on the New York Stock Exchange.

advertisement | advertise on newsday

Consumer-focused companies, banks and health care stocks were among the biggest gainers. Real estate companies lagged the most. Energy stocks also fell after a drop in crude oil prices.

ON WALL STREET: At the close, the Nasdaq was up 20 points, about 0.4 percent, at 5,555.8. The Dow Jones industrial average down 31.9, about 0.2 percent, at 19,855.5. The Standard & Poor’s 500 index was right where it started at 2,268.9.

OIL PRICES: As markets closed, U.S. benchmark crude oil slipped $1.21 to $51.66 a barrel in electronic trading on the New York Mercantile Exchange. In London on the Intercontinental Exchange Europe, Brent crude, which is used to price oil sold internationally, was down $1.34 at to $53.60 a barrel.

BOND PRICES: The yield on the 10-year Treasury note rose to 2.389.