The objective of the wash-sale rule is to disallow a loss deduction where you recover your market position in a security within a short period of time after the sale. Under the wash-sale rule, which applies to investors and traders (but not dealers), your loss deduction is barred if within 30 days of the sale you buy substantially identical stock or securities, or a “put” or “call” option on such securities. The wash-sale period is 61 days—running from 30 days before to 30 days after the date of sale. The end of a taxable year during this 61-day period does not affect the wash-sale rule. The loss is still denied. If you sell at a loss and your spouse buys substantially identical stock within this period, the loss is also barred.
The wash-sale rule does not apply to gains. It also does not apply to acquisitions by gift, inheritance, or tax-free exchange.