What is the wash sale rule?

Cfefinances

The wash sale rule disallows a tax deduction on a loss if the investor buys the same or a substantially identical security within 30 days before or after the sale.
Think about the IRS blocking a quick tax-loss trick. Rebuy the same security within 30 days of selling at a loss and the deduction is disallowed.