Stocks ended a volatile session in negative territory on Monday as investors were rattled by concerns regarding leveraged mortgage securities held by two hedge funds operated by Bear Stearns.

"We will see a splash near term as some of these funds need to unwind positions in paper that really isn't traded too much," said Jack Ablin, chief investment officer at Harris Private Bank. "There is going to be a couple of weeks of sloppy trading in that space."

Stocks had another bumpy day, closing with loss on Tuesday, as subprime mortgage concerns continued to color trading.

"The market is looking for direction and it seems like everyday recently, the market has been hit with developments it doesn't like," said Brian Hicks, president of Wealth Daily. "I think the market is looking for some light at the end of the tunnel and it looks like the housing problem will continue longer than expected."

Lennar the second largest U.S. homebuilder, reported a quarterly loss on Tuesday, citing charges related to land values and declining demand related to the subprime-mortgage meltdown.

Stocks closed Wednesday higher, led by gains in technology and energy shares as well as a drop in Treasury bond yields.

Major indexes had fallen earlier in the day after weaker-than-expected durable goods data but then rebounded in the afternoon.

"I think a lot of people see setbacks to be bargain time", said Michael Metz, chief investment strategist at Oppenheimer. "When declines fail to gain traction, bargain hunters step in and buy, not seeing the market in trouble."