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.

The report said that building permits increased to an annual rate of 894,000 from a downwardly revised 801,000 in August. Economists were anticipating a September rate of 810,000.

The FTSE 100 in London was rose 0.69% and the DAX in Germany was up 0.25% after Moody's decided to keep Spain's credit rating at investment grade level.

The Nikkei Average in Tokyo closed higher by 1.21% on Wednesday and the Hang Seng in Hong Kong settled up 0.99% after Japanese Prime Minister Yoshihiko Noda told his ministers to put together an economic stimulus plan.

November crude oil futures closed up 3 cents at $92.12 a barrel. December gold futures rose $6.70 to settle at $1,753 an ounce.

The benchmark 10-year Treasury fell sharply, down 30/32, pushing the yield higher to 1.827%. The dollar sank 0.22%, according to the dollar index.

Elsewhere in corporate news, power and hand tools company Stanley Black & Decker ( SWK) posted lower-than-expected third-quarter profit, citing challenges in Europe, while remaining optimistic about the U.S. and Asia. Shares surrendered 4.4%.

CSX ( CSX) shares fell 2% after the rail-based transportation services company posted third-quarter revenue that came in short of expectations.

ASML ( ASML), the biggest supplier of equipment to semiconductor manufacturers, offered to buy Cymer ( CYMI) for about $2.55 billion in cash and stock. ASMl shares fell 6.5%. Cymer shares rose more than 49.4%.

Shares of Apollo Group ( APOL) plunged 22.2% after the for-profit education company fell short of revenue views for its latest quarter and announced a massive restructuring on Tuesday.

U.S. Bancorp ( USB) continued its strong earnings streak, as mortgage origination volume remained very strong. Shares rose 1.8%.

Bank of New York Mellon ( BK) reported a 7% year-over-year increase in management fees. Shares gained 5.5%.

Shares of eBay ( EBAY) slipped in after-hours action after the online auctioneer beat Wall Street's profit view by a penny in the third quarter but revenue was a bit soft and there was downside to its outlook for the fourth quarter vs. the consensus expectations. The stock was down 1%.

--Written by Andrea Tse and Joe Deaux in New York.

>To contact the writer of this article, click here: Andrea Tse.

More from Markets

Stocks Tumble as Trump Calls Off North Korea Summit

Stocks Tumble as Trump Calls Off North Korea Summit

Stocks Could Easily Crater Into Memorial Day Weekend

Stocks Could Easily Crater Into Memorial Day Weekend

Video: Here Is How Real Estate Investment Trusts Can Boost Your Portfolio

Video: Here Is How Real Estate Investment Trusts Can Boost Your Portfolio

Celgene Shares Rise on Plans to Increase Stock Buybacks

Celgene Shares Rise on Plans to Increase Stock Buybacks

Global Stocks Slide as Trump's New Trade War Salvo Ignites Fresh Concern

Global Stocks Slide as Trump's New Trade War Salvo Ignites Fresh Concern