Stocks Zigzag Higher - TheStreet

Updated from 4:15 p.m. EDT

Stocks on Wall Street had an erratic day, trading in and out of positive territory amid a downturn in oil prices and lingering worries about the financial sector, before finally settling in the green.

The

Dow Jones Industrial Average

rose 68.88 points, or 0.6%, to 11,417.43, and the

S&P 500

added 7.85 points, or 0.6%, at 1274.54. The

Nasdaq

tacked on 4.72 points, or 0.2%, to 2389.08.

At the open, the market crept to the upside but quickly lost momentum. However, stocks spent most of their time with gains following a pullback in crude-oil prices. That came after the Energy Department said crude inventories for the week ended Aug. 16 climbed by 9.4 million barrels, a much larger increase than expected by analysts.

Oil prices had been near $116 a barrel earlier, but following the data settled up 67 cents at $115.20 a barrel.

Technology shares got support from PC maker and Dow component

Hewlett-Packard

(HPQ) - Get Report

, whose third-quarter earnings beat Wall Street's estimates for both the top and bottom line. Shares jumped 5.7% to $46.16.

Semiconductor maker

Analog Devices

(ADI) - Get Report

posted a profit that rose year over year and beat analyst expectations. Less fortunate among tech companies,

Novatel Wireless

(NVTL)

reported earnings that lagged estimates. Despite the beat, Analog Devices tumbled 8.9% to $29.29. Novatel plummeted 25% to $6.29.

In the financial sector, mortgage financier

Freddie Mac

( FRE) had difficulties auctioning off $3 billion in its debt, prompting uncertainty about its ability to avoid a bailout by the government.

Queasiness over the fate of the government-sponsored entity and its sister company,

Fannie Mae

( FNM), contributed to losses for the major indices on Monday and Tuesday. Both were again a drag for the market Wednesday, as Fannie dropped 27% to $4.40 and Freddie lost 22% to $3.25.

Elsewhere, the

New York Post

reported that brokerage

Lehman Brothers

( LEH), similarly harried by its exposure to the credit crisis, failed to come through with a $5 billion capital injection from South Korean institutions.

In spite of the news, reports that the firm would sell all or part of its asset-management business and lowered earnings estimates from Goldman Sachs, Lehman shares traded higher by 5.1% to $13.73.

Goldman also cut its earnings outlook on

Citigroup

(C) - Get Report

,

JPMorgan

(JPM) - Get Report

,

Merrill Lynch

( MER) and

Morgan Stanley

(MS) - Get Report

.

Citigroup nonetheless ended the day up 1.8% to $17.49. JPMorgan climbed 4% to $37, and Merrill added 2.5% to $24.41. Morgan Stanley dropped 1.8% to $37.40.

Robert Pavlik, chief investment officer at Oaktree Asset Management wrote in an email that ongoing problems in the credit markets, high commodity prices and a weak jobs market continue to weigh down stocks. Last week's rally in the major indices was a bear-market bounce, he wrote.

"As investors begin to refocus their attention back to the root cause of lower commodity prices, namely slowing worldwide economic growth and high inflation, I expect the recent rally will run out of stream."

In terms of economic data, the Mortgage Bankers Association released a report indicating that mortgage applications were near a five-year low for the week ended Aug. 15. The MBA purchase index fell to 314 from 315.2 a week ago.

Longer-term U.S. Treasury prices were rising slightly. The 10-year was gaining 8/32 to yield 3.8%, and the 30-year was up 10/32, yielding 4.44%. The dollar was rallying against its major foreign competitors. Gold lost 50 cents to close at $816.30.

Exchanges worldwide were mixed. The FTSE in London, the DAX in Frankfurt and the Hang Seng in Hong Kong were higher, while the Nikkei in Japan edged slightly downward.

Get your daily dose of Jim Cramer and all the stocks in his head. Sign up for the free Daily Booyah! newsletter by clicking here.