WhitmanTrading

The Wash-Sale Rule

A wash sale happens when a security is sold at a loss and a substantially identical one is bought inside a defined window around that sale, which disallows the loss for that year. The disallowed amount is generally added to the replacement's cost basis rather than lost.

The rule exists because otherwise anyone could sell at a loss, buy straight back, and claim a deduction without ever changing their position. Understanding what it actually catches is more useful than memorising a number of days.

How it works

A candlestick chart with a sale and a rapid repurchase.
Sell at a loss, buy back too soon. Illustrative chart - not real market data.

Sell a security at a loss, and buy the same or a substantially identical one inside the window, and the loss is disallowed for that tax year.

The first half of a price series with a symmetric window marked.
The window runs both directions around the sale. Illustrative chart - not real market data.

The window is symmetric in several jurisdictions — it covers purchases before the sale as well as after. Only checking forward is the most common misreading.

A section of the price series with an adjusted entry level.
The disallowed loss moves into the new cost basis. Illustrative chart - not real market data.

The loss is not destroyed. It is generally added to the cost basis of the replacement holding, so it reduces a future gain instead of this year’s. The timing changed, not the total.

What counts as substantially identical

A window of price bars with two closely related paths.
The vague term is where the judgement lives. Illustrative chart - not real market data.

The same security is obviously identical. Two funds tracking different indices are generally treated as not identical, even where they behave similarly.

Two funds tracking the same index are a harder question, and reasonable people are cautious about it. Options and warrants on the same underlying can also be caught.

The phrase is deliberately imprecise, which means the safe approach is to leave a clear gap rather than to find the edge. This is educational, not tax advice.

A worked example

The second half of a price series with a disallowed and an allowed case.
Two sequences, two different outcomes. Illustrative chart - not real market data.

Take a holding bought at 40,000, sold at 32,000 — an 8,000 loss.

Case one: the same fund is repurchased eleven days later. The loss is disallowed and 8,000 is added to the new basis, so a repurchase at 32,000 has a basis of 40,000.

Case two: a different index tracker is bought the same afternoon. The loss is generally allowed, the exposure never stopped, and the new holding’s basis is 32,000.

Both keep you invested and only one banks the loss this year. The difference is which fund was bought, not how long anyone waited.

Where it catches people

A candlestick series with an automatic purchase inside a window.
Automatic reinvestment is a purchase like any other. Illustrative chart - not real market data.

Automatic dividend reinvestment is the most common accidental trigger. It buys a few units inside the window without anyone deciding to, and it can disallow part of the loss.

Regular scheduled contributions do the same thing, particularly where they buy the same broad fund every month.

Other accounts count. A purchase in a retirement account, or in a spouse’s account, can trigger it depending on jurisdiction — and in some cases a purchase inside a sheltered account permanently destroys the loss rather than deferring it, because there is no basis to add it to.

Costs and record-keeping

A candlestick chart annotated with the round-trip cost of a switch.
Every attempt is two transactions regardless. Illustrative chart - not real market data.

A disallowed loss still cost you the trades. On this site’s shared series a round trip measures about 2% of the median bar range of 0.493 — paid whether the loss counted or not. The figures are in research/series-measurements.json.

A long-horizon candlestick view with adjusted basis carried forward.
And the adjusted basis has to be tracked for years. Illustrative chart - not real market data.

The adjusted basis has to be carried forward accurately, sometimes for years. Brokers often report this and their reporting does not always cover purchases made elsewhere, which is where the discrepancies come from.

A checklist that avoids it

Switch off automatic reinvestment on the holding before selling it, and leave it off until the window has closed. This is the single most effective step and it takes seconds.

Pause any scheduled contribution that buys the same fund, in every account, including ones you do not think of as investing accounts.

Decide the replacement before selling. Choosing in the moment is how people end up either sitting in cash or buying back the same thing.

Write down the sale date and the window’s end. Losses are usually harvested near a year end, when several other things are also happening, and the date is easy to lose track of.

And keep the trade confirmations. The adjusted basis may need to be defended years later, and the broker’s report will not include purchases made elsewhere.

The original data

Of the 24,971 unique videos in research/search-study-corpus.jsonl, 2 have a title about wash sales, at a median of 90,257 views across 2 channels — and 50% use beginner-shaped language. Tax-loss harvesting returns zero videos and capital gains tax appears in 1 at 233,662. The counts come from site/rank_investing.py, which deduplicates by video id.

A candlestick series with several gaps, the largest of them marked.
A gap can produce the loss and the temptation together. Illustrative chart - not real market data.

Two videos at a 90,257 median for a narrow procedural rule. People search for this after being caught by it, which is why the audience per video is so much larger than the subject’s apparent size.

Price bars with entries planned in advance.
Sold at a loss and it is rising again. Buy back? Illustrative chart - not real market data.

The answer to the question above is that buying the same holding back inside the window disallows the loss and leaves you where you started with worse records. If you want the exposure immediately, a different tracker keeps it. If you specifically want that fund back, waiting out the window is the price of the deduction — and whether that is worth it depends on the size of the loss.

A stretch of price bars cut short at a decision point.
The loss was disallowed. Does it matter? Illustrative chart - not real market data.

Usually less than it feels. In a taxable account the amount moves into the new basis and reduces a future gain — so the cost is the deferral, not the deduction.

When it fails

The case that actually destroys value is a repurchase inside a sheltered account. In several jurisdictions there is no basis adjustment available there, so the disallowed loss does not move anywhere — it is simply gone. Somebody harvests a loss in a taxable account while a monthly contribution buys the same fund in a retirement account on the same schedule it has for years, and the deduction disappears permanently without a single deliberate decision having caused it.

The second failure is only checking forward. The window looks backwards too.

A third is forgetting automatic reinvestment. It is a purchase.

A fourth is relying entirely on broker reporting. It cannot see other institutions.

A fifth is being out of the market to be safe. That is a timing bet with its own cost.

And a sixth is treating “substantially identical” as a solved question. It is deliberately vague, so leave room.

Tax-loss harvesting is the operation this rule constrains. Cost basis is where a disallowed loss goes. And taxable accounts is the only place any of it applies.

What I actually do

The detail that catches people is that it looks backwards too. Buying more of something in the weeks before you sell the rest of it at a loss can trigger this, which is exactly what somebody averaging down and then giving up would do — and it is the most natural sequence in the world.

— Michael Whitman

This page is educational, not financial advice. Test every idea on your own charts before risking money.