U.S. stocks trimmed gains to trade flat on Monday as investors locked in some profits in cautious trading before earnings season picks up steam.

With many market players away for the Columbus Day holiday, volume was light, making the market choppy. The Nasdaq turned negative, but the Dow and the S&P 500 managed to stay above water as energy shares gained alongside the price of oil.

If the broad S&P 500 closes higher, it will be its sixth day of gains.

This would be the S&P's longest winning streak since another six-day runup in late May and early June 2007.

Optimism about the earnings season that is getting under way has fueled stocks' recent advance, pushing the S&P 500 up almost 60 percent from March's 12-year closing low. As a result, some investors took the opportunity to cash in profits, analysts said.

You're seeing prudence taking the lead here, with people starting to lock in profits in hopes we don't see a pretty big move down after some of the larger companies report over the next few days, said Michael James, senior trader at regional investment bank Wedbush Morgan in Los Angeles.

Black & Decker Corp jumped 6.4 percent to $50.25 as the power tools maker raised its third-quarter earnings outlook ahead of a series of blue-chip earnings reports this week.

Chevron and Exxon Mobil led the Dow as optimism over the economic recovery pushed the price of oil up 2.1 percent. Front-month U.S. crude oil futures gained $1.50 to settle at $73.27 a barrel. Chevron's stock rose 1 percent to $73.51 and Exxon shot up 1.1 percent to $70.00.

The Dow Jones industrial average <.DJI> inched up 5.59 points, or 0.06 percent, to 9,870.53. The Standard & Poor's 500 Index <.SPX> added 2.89 points, or 0.27 percent, to 1,074.38. The Nasdaq Composite Index <.IXIC> dipped 4.22 points, or 0.20 percent, to 2,135.06.

(Reporting by Leah Schnurr; Editing by Jan Paschal)