NEW YORK ( TheStreet) -- The major U.S. equity averages overcame weakness in the tech sector to close in positive territory Wednesday as strength in housing starts prompted a rally in basic materials stocks.

Earnings disappointments from heavyweights IBM ( IBM) and Intel ( INTC) were a headwind for the broad market all day, but overall breadth was very positive throughout the session.

The Dow Jones Industrial Average gained more than 5 points, or 0.04%, to finish at 13,557. The blue-chip index, which has now built its winning streak up to four days, ran as low as 13,469 during the session.

Breadth within the Dow was positive with winners ahead of losers, 23 to 7. The biggest percentage gainers were Alcoa ( AA), Caterpillar ( CAT), Johnson & Johnson ( JNJ), and Walt Disney ( DIS).

IBM and Intel were by far the biggest losers among the blue chips. IBM's stock dropped 4.9% after Big Blue came up short on revenue in the third quarter, while Intel shares fell 2.5% after the world's biggest chip maker's outlook failed to impress.

Aside from IBM and Intel, Cisco ( CSCO), Coca-Cola ( KO), McDonald's ( MCD), and UnitedHealth ( UNH) were among the other Dow decliners.

Shares of Bank of America ( BAC) slipped 0.21% after the Charlotte, N.C.-based bank edged Wall Street's profit view.

The S&P 500 closed up 6 points, or 0.41%, at 1461, while the Nasdaq lost 3 points, or 0.10%, to settle at 3104.

The strongest sectors were basic materials, conglomerates, energy and utilities. Only the technology finished in the red.

Advancers were ahead of decliners by a 2-to-1 ratio on the New York Stock Exchange, and 1.5-to-1 on the Nasdaq. Volume totaled 3.64 billion on the Big Board and 1.77 billion on the Nasdaq.

The latest read on builder confidence came in much better than expected after the Census Bureau said housing starts rose to a seasonally adjusted annual rate of 872,000 in September from an upwardly revised 758,000 in August. Economists were expecting a rate of 770,000 for September. The SPDR S&P Homebuilders ( XHB) index surged nearly 2%.

"While we are nowhere near the peak, one has to go back to the middle of 2008 to find the last time starts were running at this level," said Dan Greenhaus, chief global strategist at BTIG.

"If there was any doubt that the housing market was undergoing a recovery, even a modest one in the face of the terrible 2008 decline, those doubts should be erased by now," he added.

If you liked this article you might like

Forecast for S&P 500, Dow Industrials Remains Bullish, These Charts Show

Dow 20,000! It Should Mean Nothing to Investors, but Then Again...

Tradebird Investors Are Bullish on U.S. Stocks but Bearish on the Euro

Why Home Depot and Boeing Stock Fell Tuesday