Blog / The Wash Sale Rule, Explained: The 61-Day Window, Substantially Identical Securities, IRAs, Crypto, and What It Means for Active Traders
The Wash Sale Rule, Explained: The 61-Day Window, Substantially Identical Securities, IRAs, Crypto, and What It Means for Active Traders

The wash sale rule says that if you sell a stock or other security at a loss and buy the same or a substantially identical one within 30 days before or after the sale, you cannot deduct that loss on this year's taxes. The loss is not destroyed. It is added to the cost basis of the replacement shares, so you get it back when you finally sell those shares and stay out for more than 30 days. The rule is in Section 1091 of the tax code and the IRS explains it in Publication 550.
That is the whole rule in three sentences, and most of the trouble comes from the details: what counts as 30 days, what counts as substantially identical, what happens when the replacement buy lands in your IRA, and what it means for an account that trades the same handful of symbols again and again. This guide covers each of those, with the worked numbers, and finishes with something we have not seen written down anywhere else: how often a real automated account actually trips the rule, measured from our own trade data.
The 30-day rule is really a 61-day window
The statute counts 30 days before the sale, the day of the sale, and 30 days after it. Those are calendar days, not trading days, and weekends and market holidays count. Say you sell a losing position on Monday, November 16, 2026. The window runs from October 17 through December 16. Any purchase of the same security in that span, including a purchase you made in October before you ever thought about selling, turns the November sale into a wash sale.
Measured in trading days the window is shorter than it sounds. The 30 calendar days after a November 16 sale contain 21 trading days (Thanksgiving falls inside them), and the 30 days before contain 20. Sell on December 31 and the window runs to January 30, 2027, which is 19 trading days with the New Year's Day and Martin Luther King Jr. Day closures. The practical rule many traders use is simple: if you want the loss this year, stay out of the name for 31 calendar days, counting from the day after the sale.
Because the window reaches backward, the order of the trades does not matter. Buying on November 1 and selling the older lot at a loss on November 16 is a wash sale just as surely as selling first and rebuying later. The same goes for dividend reinvestment: a reinvested dividend that buys a few shares inside the window is a purchase, and it washes the loss on that many shares.
What "substantially identical" means
The IRS has never published a precise definition, so this is where most of the judgment lives. What is settled:
- The same stock, in any account you control, is identical. That includes a second brokerage account, a joint account, and (by Revenue Ruling 2008-5) your IRA or Roth IRA. A spouse's account counts too under Publication 550.
- A call option on the same stock counts. The statute disallows the loss if you have "entered into a contract or option so to acquire" the stock, so selling shares at a loss and buying calls on the same company inside the window is a wash sale.
- Stock of a different company is not identical, even in the same industry. Selling one bank and buying another the same day is fine.
- Two funds that track the same index are the gray zone. The IRS has not ruled on whether, for example, two S&P 500 ETFs from different sponsors are substantially identical. Many tax professionals treat them as identical because they hold the same stocks in the same weights; many investors swap between them anyway. If you are harvesting a loss in an index fund, the conservative move is to buy a fund that tracks a different index, which is also one of the arguments for holding ETFs rather than single stocks in a taxable account.
- Bonds and preferred stock of the same company are generally not identical to its common stock, unless the preferred is convertible and trades like the common.
What actually happens to the loss
A wash sale defers the loss rather than deleting it, with one important exception covered below. Two things happen under Section 1091(d) and Publication 550:
- The disallowed loss is added to the cost basis of the replacement shares. You bought 100 shares at $50, sold them at $40 for a $1,000 loss, and bought 100 shares back at $42 a week later. The $1,000 loss is disallowed for now, and your basis in the new shares becomes $42 plus $10, or $52 a share. Sell them later at $55 and your taxable gain is $3 a share, not $13. The loss was not lost; it shrank a future gain.
- The holding period of the old shares carries over to the new ones. If you had held the original lot for ten months, the replacement lot starts with ten months on the clock, which matters for whether the eventual gain is long-term or short-term.
If you buy back fewer shares than you sold, only the matching portion of the loss is disallowed. Sell 100 at a loss and buy back 40, and 40 percent of the loss is deferred while 60 percent is deductible this year.
The IRA trap, where the loss really is gone
Here is the exception. In Revenue Ruling 2008-5, the IRS held that when you sell stock at a loss in a taxable account and buy the same stock in your IRA or Roth IRA within the window, the loss is disallowed and your basis in the IRA is not increased. Because the IRA has no cost basis in the ordinary sense, there is nowhere for the deferred loss to go. It is permanently lost. This is the one version of the rule to treat as a hard stop: never buy in a retirement account what you just sold at a loss in a taxable one, and if you run automated trading in a Roth IRA, keep its symbol list separate from your taxable account's.
How it shows up on your tax forms
Your broker reports wash sales for you, with limits. Form 1099-B box 1g shows the disallowed wash sale loss for sales of identical securities (the same CUSIP) inside the same account. The broker will not match sales against purchases in a different account, in your IRA, in your spouse's account, or against a substantially identical security with a different CUSIP. Those are yours to track.
On Form 8949, a wash sale gets code W in column (f) and the disallowed amount as a positive number in column (g), which backs the loss out of the total. If your broker's box 1g is wrong, the instructions tell you to enter the correct amount yourself. Software fills all of this in from the 1099-B, which is why most people never see it, and why the cross-account cases are the ones that cause audits.
Does the wash sale rule apply to crypto?
Not as of October 2026. Section 1091 applies to "stock or securities," and the IRS treats cryptocurrency as property, so selling bitcoin at a loss and buying it back the same hour still produces a deductible loss today. That is why crypto's 24-hour market has been the easiest place to harvest losses.
It may not last. The House Ways and Means Committee voted 38 to 5 on September 16, 2026 to advance H.R. 10357, the Digital Asset Tax Certainty Act, which would extend the wash sale rule to widely traded digital assets, with an effective date of September 14, 2026 as amended, per 24/7 Wall St's report on the vote. It is not law. It still needs the full House, the Senate and a signature, and similar proposals have died every year since 2021. But the retroactive effective date means that if it passes, crypto losses from this fall could be caught. Anyone harvesting crypto losses in late 2026 should know that risk exists. Form 1099-DA, the new crypto reporting form, already has a box 1i for disallowed wash sale losses, so the plumbing is in place.
Day traders and automated accounts: deferral, not disaster
If you trade the same names repeatedly, you will have wash sales. Lots of them. Your 1099-B will show a large number in box 1g and it will look alarming. For most active traders it is not, for one reason: a wash sale inside a single tax year washes out. The disallowed loss moves into the basis of the next lot, that lot is sold a day or a week later, and the loss is recognized then. By December the chain has resolved itself, as long as the last lot is closed and not reopened for 30 days.
The damage happens at the year-end boundary. A loss taken in December that is repurchased in January gets pushed into next year's return, and a December loss in a stock you keep holding into the new year is deferred until you finally sell. The rule of thumb: for every name you trade actively, be flat by December 31 or accept that December's losses belong to next year. The last sale date whose full 30-day window closes inside 2026 is December 1.
There is a formal escape hatch for full-time traders. A trader who qualifies for trader tax status and makes the mark-to-market election under Section 475(f) is exempt from the wash sale rule entirely, per IRS Topic 429. The election must be made by the due date of the prior year's return, it converts all trading gains and losses to ordinary income, and it is a decision to make with a tax professional, not from a blog post.
How often an automated account actually trips the rule
We wanted a real number instead of a warning, so we measured our own members' trading. In JorgAI's live brokerage accounts to date, 5 of 27 losing stock sales were followed by a purchase of the same symbol within 30 days, and all five re-entries happened the same day, which is the auto-trader buying a name back after a stop-loss on a fresh signal. In paper accounts, where members test more aggressive settings, it was 16 of 74 losing sales, with a median gap of three days. No crypto re-entry hit the window at all. Small numbers, but the pattern is clear: roughly one losing sale in five turns into a wash sale, and almost all of them come from same-day re-entries after a stop.
Three things reduce that count without touching the strategy. First, scope: an auto-trader that scans a fixed watchlist of a few names will recycle those names, while one that scans a broad list spreads its entries out. Second, a cooldown: JorgAI's intraday scanner will not re-score a symbol it just predicted for one to two hours depending on the risk setting, and a longer cooldown means fewer same-day re-buys. Third, the stop itself: a stop-loss set wide enough that it is not hit by normal noise produces fewer losing sales to begin with, which is the real fix for cutting losses without churning. None of this is a wash-sale guard, and we do not pretend to have one. The guard is a flat book on December 31.
A year-end checklist
- By December 1: decide which losing positions you want to harvest for this year, so the full 30-day window closes inside the year.
- Check the 30 days before each sale: any purchase of the same name since early November, including reinvested dividends, already taints the loss.
- Check every account you control: second brokerage, IRA, Roth, spouse. The broker only sees its own.
- Replace with something not substantially identical: a different company, or a fund on a different index, if you want to stay invested.
- Be flat in actively traded names by December 31, or accept that December's losses move to next year.
- In January, do nothing for 31 days in any name you harvested in December.
If you would rather have rules like a stop-loss, a cooldown and a scope enforced for you automatically, in the brokerage account you already have, that is what JorgAI does. You can set it up in a few minutes and test it with paper money first.
Quick answers
What is the wash sale rule in one sentence? You cannot deduct a loss on a stock or security if you buy the same or a substantially identical one within 30 days before or after the sale; the loss is added to the basis of the replacement shares instead.
Is it 30 days or 61 days? Both. The window is 30 calendar days before the sale, the sale day, and 30 calendar days after, which is 61 days in total. To be safe, wait 31 calendar days after the sale before buying back.
Do I lose the money? Usually not. The loss is deferred into the cost basis of the new shares and recognized when you sell them. The exception is buying the replacement in an IRA, where the loss is permanently gone.
Does the wash sale rule apply to crypto? Not as of October 2026. A bill that would change that, H.R. 10357, cleared the House Ways and Means Committee on September 16, 2026 with a September 14, 2026 effective date, but it has not passed Congress.
Does it apply across different brokers? Yes. The rule applies to you, not to the account. Brokers only report wash sales within a single account, so cross-account matches are your responsibility on Form 8949.
Do day traders have to worry about it? Only at year end. Wash sales within the year resolve as the chain of trades closes. December losses repurchased in January, or held into the new year, get pushed into next year's return. Full-time traders can elect mark-to-market treatment under Section 475(f), which removes the rule entirely.
Does a stop-loss cause wash sales? It can, if the system buys the same name back within 30 days. In JorgAI's live accounts, 5 of 27 losing stock sales were followed by a same-day re-buy, which is where almost all of our members' wash sales come from.
Sources: 26 U.S. Code Section 1091; IRS Publication 550 (2025); Instructions for Form 8949 (2025); IRS Revenue Ruling 2008-5; IRS Topic 429; House Ways and Means Committee vote on H.R. 10357 as reported September 17, 2026. JorgAI re-entry figures computed from members' closed trades through October 12, 2026. This article is general education about U.S. federal tax rules as of October 2026, not tax advice. Talk to a tax professional about your own situation.
Keep reading

Getting Started / Oct 12, 2026
Cash Account vs Margin Account: T+1 Settlement, Good Faith Violations, Margin Calls, and Which One an Automated Trader Should Use

Risk Management / Oct 12, 2026
Risk/Reward Ratio, Explained: The Break-Even Math, What 76 Years of S&P 500 Data Say About Two to One, and What Traders Actually Set
Let the AI do the trading.
Set it up in minutes. 7 day free trial on Starter and Pro.
Get started free