By Scalpel Team. , updated . 8 min read.

In short
The wash sale rule disallows a loss on a stock you sold if you buy substantially identical stock within 30 days before or after the sale. The loss is not gone: it is added to the cost basis of the shares you bought, and comes back when you sell them. For a day trader who trades the same tickers again and again, most losses are deferred trade to trade and the year's total comes out the same. The rule bites at year-end, when you buy in an IRA, and when you trade one stock across several accounts. Traders with a section 475(f) mark-to-market election are exempt.
Day traders meet the wash sale rule on their first Form 1099-B: a column of "wash sale loss disallowed" figures that can be larger than the account. It looks alarming and is usually less so. This post explains the rule from IRS Publication 550, works through what it does to a scalper's same-day round trips, and shows the three situations where it costs real money.
This is general information, not tax or legal advice. Tax situations differ; for your own return, use a tax professional who works with traders. IRS sources checked on October 22, 2026. Scalpel is independent and not affiliated with or endorsed by Interactive Brokers.
The rule is section 1091 of the Internal Revenue Code (26 U.S.C. 1091). The IRS explains it in Publication 550, under Wash Sales. A wash sale happens when you sell stock at a loss and, within 30 days before or after the sale, you:
It also applies if your spouse or a corporation you control buys the substantially identical stock. The window runs from 30 days before the sale to 30 days after it: 61 days with the sale day in the middle.
The consequence, in Publication 550's words: "add the disallowed loss to the cost of the new stock or securities (except in (4) above)." The holding period of the new shares also includes the holding period of the ones you sold. The IRS's own example: you buy 100 shares for $1,000, sell them for $750, and buy 100 again for $800 within 30 days. The $250 loss is disallowed, and your basis in the new shares is $1,050.
"Substantially identical" is a facts-and-circumstances test. Publication 550 says stock of one company is ordinarily not substantially identical to stock of another company. Two traps matter for small-cap traders. A company's convertible preferred stock can count. And if you sell common stock at a loss and at the same time buy warrants on the same company's common, the wash sale rules apply.
This IBKR Traders' Academy lesson covers wash sales together with the other special capital gains cases. It is from 2019, but the wash sale rule it describes has not changed:

Most of a scalper's wash sales look like this. ABCD is fictional, and fees are ignored to keep the numbers clean.
| Time (ET) | Trade | Cash result | What the rule does | Reported gain or loss |
|---|---|---|---|---|
| 09:40 | Buy 1,000 ABCD at $4.00 | |||
| 09:45 | Sell 1,000 at $3.80 | -$200 | Loss, but shares are bought again within 30 days | $0, $200 disallowed |
| 09:52 | Buy 1,000 ABCD at $3.90 | Basis becomes $3,900 + $200 = $4,100 | ||
| 10:05 | Sell 1,000 at $4.05 | +$150 | Proceeds $4,050 against a $4,100 basis | -$50 |
| Total | -$50 | -$50 |

You lost $50 in cash and you report a $50 loss. The $200 was not lost for tax purposes; it moved into the next trade. If you buy ABCD again within 30 days of the 10:05 sale, that $50 moves again. Run this across a busy year in the same handful of tickers and your 1099-B can show tens of thousands of dollars of disallowed losses while your net result is unchanged, as long as everything is closed out cleanly at the end.
The rule matches share for share. Publication 550 says to match the shares bought with an equal number of the shares sold, in the order you bought them. If you sell 1,000 ABCD at a $200 loss and buy back only 500 within 30 days, the loss on 500 shares ($100) is disallowed and added to those 500 shares' basis. The loss on the other 500 ($100) is deductible.
Scaling in and out complicates this quickly: three entries and four exits in one stock produce a lot of partial matches. That is what your broker's 1099-B and tax software are for, but it helps to know why the numbers look strange.
The rule ignores the calendar year. A loss taken on December 30 and a repurchase on January 5 is a wash sale, and the loss moves into the new year's basis.
| Date | Trade | Effect |
|---|---|---|
| December 30 | Buy 2,000 WXYZ at $5.00, sell at $4.70 | $600 loss, disallowed this year |
| January 5 | Buy 2,000 WXYZ at $4.80 | Basis $9,600 + $600 = $10,200 |
| January 5 | Sell 2,000 WXYZ at $4.90 | Reported: -$400 next year (cash: +$200) |
If you had $10,000 of short-term gains earlier in the year, you are taxed on $10,000 instead of $9,400, and the $600 shows up a year later. The same thing happens if you sell at a loss late in December, buy back, and are still holding on December 31: the loss sits inside an open position. Publication 550 has an example of exactly this, with a December 27 sale and a January 10 purchase.
The fix is simple: in the last days of December, a loss in a stock you are likely to trade again in early January deserves a moment's thought.
Rule 4 above is the expensive one. If you take a loss in your taxable account and buy the same stock in your IRA or Roth IRA within 30 days, the loss is disallowed and, because of the "except in (4)" wording, it is not added to the basis of anything. It is gone. If you trade small caps in a taxable account, keep them out of your retirement accounts.
Your broker can only see its own accounts. Publication 550 says Form 1099-B box 1g shows the disallowed wash sale loss only when the shares were covered securities and the replacement shares "had the same CUSIP numbers as the stock or securities you sold and were bought in the same account." It then adds: "you cannot deduct a loss from a wash sale even if it is not reported on Form 1099-B." A loss at one broker and a rebuy at another within 30 days is your job to find and report.
Like every US broker, Interactive Brokers reports your sales on Form 1099-B, and the wash sale amounts a broker must report follow that same-account, same-CUSIP rule. Two practical notes:
If net losses survive the wash sale rule, they are still capital losses: per IRS Topic 409, you can deduct up to $3,000 a year ($1,500 if married filing separately) against other income and carry the rest forward.
IRS Topic 429, on traders in securities, says "the wash sale rules, and certain other rules do not apply to traders using the mark-to-market method." That method needs two things: you qualify as a trader in the business of trading (a demanding facts-and-circumstances test), and you made the section 475(f) election on time, which for most individuals means by the original due date of the previous year's return. Gains and losses then become ordinary and the $3,000 capital loss limit no longer applies. It is a large decision with trade-offs, covered in our post on day trading taxes and trader tax status.
All the account-level rules that sit next to this one are collected in our pillar on day trading rules, and a full cost picture, taxes aside, is in the real cost of day trading. For keeping records that help at tax time, see a day trading journal that improves your trading.
Scalpel is not tax software and does not compute wash sales. What it gives you is a clean record of your own trading. Every trade closed by a key, a stop, a take-profit or a flatten goes into the current mode's journal with its entry, exit, size, fees and R, and the Analytics view shows them net of fees (analytics guide). It measures results in R as well as dollars (R multiples), which is the number that tells you whether a strategy works before taxes ever enter into it.
SIM and LIVE keep separate journals, and SIM trades are paper trades with no tax consequence at all. LIVE fees are the commissions IBKR reports for each fill, so the journal's net matches what you actually paid (commissions). The journal is a plain text file per mode in Scalpel's data folder, one trade per line; for tax filing, use IBKR's 1099-B. This video shows how the two modes work:

Scalpel is long only, and its stops are app-monitored rather than resting at IBKR, so they only work while Scalpel runs with a live feed.
This is general information, not tax or legal advice.
Trading carries a significant risk of loss. Nothing here is financial advice.