A wash sale happens when you sell stocks, bonds, or options for a loss but buy the same one back before or after in the same month. The losses from the sell of something you also bought in the same 30 days are not tax deductible from your profits in your trading or investing account as you still own a similar position. This is a tax rule of the U.S. Internal Revenue Service.
The wash sale rule does not allow a trader or investor who is still holding an unrealized loss to accelerate their tax deduction in the current year unless they got out and stayed out of a position. A wash sale counts in all short time frames and can even carry over into the next year if the time frame of the sell and buy back is too short.
The United Kingdom has a similar rule that is in place at the end of each calendar year and is called bed and breakfasting. A trade is considered a bed-and-breakfast position if it is sold on the final trading day of the year for a qualifying tax loss, then bought back on the first trading day of the next year. This creates a new position at a lower cost basis in the new year and the account tries to benefit from the tax loss in the previous year. The U.K. has a rule in effect that says the investor must wait the full 30 days to buy back stocks sold in the previous year if they want to claim the loss on their taxes in that tax year.
The wash sale rules do not apply to stocks sold for a capital gain.
Tax-loss harvesting is a way to try to get around the wash rule by letting enough time pass between the sell and repurchase. Selling a position for a loss with the plan to eventually buy it back after more than 30 days has passed in one way to try to create a more valid tax loss in the U.S. and U.K. at any time of the year.
Wash sales are not against SEC rules, they are just handled differently by IRS guidelines to avoid tax evasion for capital gains in a current year. Wash sale tax rules in both the U.S. and U.K. postpone any tax benefits of a wash sale for a loss. The losses from the same security bought back are then added to the cost basis of the new position, deferring any tax benefits until after a sell occurs that doesn’t qualify as a wash sale, if that ever happens in the future within a long enough time frame from entry.
Be aware that if you are trading the same stock in a short time frame your losses will not be tax deductible if you buy it back too soon.