A trader works on the floor of the New York...

A trader works on the floor of the New York Stock Exchange on Wall Street on July 27, 2016. Credit: Getty Images / Kena Betancur

U.S. stocks edged higher Wednesday as energy companies climbed with the price of oil. Banks also rose, and investors sold traditionally safe stocks. A survey showed that hiring by private companies continued at a solid but uninspiring clip in July.

Stocks opened lower but gradually recovered to finish at their highest levels of the day. The price of oil jumped after the U.S. government said gasoline stockpiles shrank last week.

A survey showed private U.S. business payrolls grew by 179,000 in July as retailers and shipping firms hired more workers. That suggests hiring is still healthy, but that wasn’t enough to excite investors.

“So much of this (economic) recovery could be correctly categorized as slow but steady,” said Mike Baele, senior portfolio manager with U.S. Bank’s private client reserve. “It’s all better than last year, for the most part, but it’s also all below expectations.”

The Dow Jones industrial average broke a seven-day losing streak and added 41.23 points, or 0.2 percent, to 18,355. The Standard & Poor’s 500 index gained 6.76 points, or 0.3 percent, to 2,163.79. The Nasdaq composite rose 22 points, or 0.4 percent, to 5,159.74.

Bond prices inched higher and the yield on the 10-year Treasury note fell to 1.55 percent from 1.56 percent.

On the latest episode of "Sarra Sounds Off," Half Hollow Hills West lacrosse and football star Anthony Raio, plus West Babylon honors recent car crash victims.  Credit: Newsday/John Paraskevas

SARRA SOUNDS OFF: Interview with Hills West's Anthony Raio  On the latest episode of "Sarra Sounds Off," Half Hollow Hills West lacrosse and football star Anthony Raio, plus West Babylon honors recent car crash victims.

On the latest episode of "Sarra Sounds Off," Half Hollow Hills West lacrosse and football star Anthony Raio, plus West Babylon honors recent car crash victims.  Credit: Newsday/John Paraskevas

SARRA SOUNDS OFF: Interview with Hills West's Anthony Raio  On the latest episode of "Sarra Sounds Off," Half Hollow Hills West lacrosse and football star Anthony Raio, plus West Babylon honors recent car crash victims.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME