5.1.1.3. Wash Sales
While losses can almost always be used to offset gains, there is a limitation. When an investor sells securities at a loss and then buys back the same or substantially identical securities within 30 days, the investor cannot use the loss to offset gains. This is considered a wash sale, according to IRS rules. Moreover, the investor could not have purchased replacement securities 30 days before the sale either—this would also be considered a wash sale because the investor is replacing the shares that they are selling at a loss. Thus, the wash sale period is 30 days before the trade and 30 days after the trade, plus the day of the trade.
Keep in mind that a wash sale is not illegal; rather, it is using t