What is a wash sale?
From FinancialPlanning
A wash sale is a transaction in which you sell a capital asset (e.g. stock or mutual fund) at a loss, but repurchase it within the 30 day window before or after the sale. The IRS does not allow you to claim that loss when computing taxes, because you didn't give up ownership of the asset for long enough.
The wash-sale window is actually a 61 day period that includes the date of the sale, the 30 days after, and the 30 days before. Any purchase of a "substantially identical" security during that 61 day period disallows the loss. The IRS has never really defined "substantially identical" but in the simplest case, it means "the same stock or mutual fund."
The loss isn't...lost, it's added to the cost basis of the repurchased shares. When you finally do sell the shares you're able to claim your loss.
Example:
You purchase shares of DotBomb Inc. for $100/share, and sell them on May 3 for $10/share. You're certain the stock is about to rise from the dead so you buy the stock again on May 30 for $9/share.
Your loss is $100 - $10 = $90/share. But because you repurchased the stock before 30 days were up, you're not able to claim that loss. Instead your $90 loss is added to the cost basis of the repurchased shares, and you'll only realize that loss if you sell the stock and don't blow it again with another wash sale.

