from IRS:
You cannot deduct losses from sales or trades of stock or securities in a wash sale unless the loss was incurred in the ordinary course of your business as a dealer in stock or securities.
A wash sale occurs when you sell or trade stock or securities at a loss and within 30 days before or after the sale you:
1.Buy substantially identical stock or securities,
2.Acquire substantially identical stock or securities in a fully taxable trade,
3.Acquire a contract or option to buy substantially identical stock or securities, or
4.Acquire substantially identical stock for your individual retirement account (IRA) or Roth IRA.
If you sell stock and your spouse or a corporation you control buys substantially identical stock, you also have a wash sale.
If your loss was disallowed because of the wash sale rules, add the disallowed loss to the cost of the new stock or securities (except in (4) above). The result is your basis in the new stock or securities. This adjustment postpones the loss deduction until the disposition of the new stock or securities. Your holding period for the new stock or securities includes the holding period of the stock or securities sold.
Example 1.
You buy 100 shares of X stock for $1,000. You sell these shares for $750 and within 30 days from the sale you buy 100 shares of the same stock for $800. Because you bought substantially identical stock, you cannot deduct your loss of $250 on the sale. However, you add the disallowed loss of $250 to the cost of the new stock, $800, to obtain your basis in the new stock, which is $1,050.
Example 2.
You are an employee of a corporation with an incentive pay plan. Under this plan, you are given 10 shares of the corporation's stock as a bonus award. You include the fair market value of the stock in your gross income as additional pay. You later sell these shares at a loss. If you receive another bonus award of substantially identical stock within 30 days of the sale, you cannot deduct your loss on the sale.