Stocks erased initial losses and turned positive on Wednesday after the Congressional Budget Office said the recent budget deal will slice projected budget deficits nearly in half over the next 10 years.

The Dow Jones industrial average gained 21.42 points, or 0.19 percent, to 11,198.18. The Standard & Poor's 500 Index rose 2.75 points, or 0.24 percent, to 1,165.10. The Nasdaq Composite Index added 2.84 points, or 0.12 percent, to 2,448.90.

(Reporting by Chuck Mikolajczak)