Direct answer for wash sales and loss harvesting rules
If your strategy sells a position at a loss, the wash sale rule can prevent that loss from being deducted now. IRS Publication 550 describes a wash sale as selling stock or securities at a loss and, in the 30 days before or after the sale, acquiring substantially identical stock or securities (IRS Publication 550: https://www.irs.gov/publications/p550).
That timing is why this is a pre-trade problem. By the time a tax form arrives, the sale is done, the exposure is gone, and the loss you were harvesting may be disallowed. Run the check as a gate before you submit the sell order.
- Scan backward and forward from the sale date, because acquisitions on either side count (IRS Publication 550: https://www.irs.gov/publications/p550).
- Include accounts you do not think of as trading accounts, including your own IRA (IRS Revenue Ruling 2008-5: https://www.irs.gov/pub/irs-drop/rr-08-05.pdf).
- Block or delay the replacement purchase rather than debating how similar two securities are.
The window runs in both directions
Most people picture a one way rule: sell now, wait a month, buy back. The definition is wider. Publication 550 covers acquiring substantially identical stock or securities in the 30 days before the sale as well as in the 30 days after it (IRS Publication 550: https://www.irs.gov/publications/p550).
Count the day of the sale along with the 30 days on each side of it and you get a 61 day span to review (IRS Publication 550: https://www.irs.gov/publications/p550). Rules based investing makes the backward half easy to miss, because the purchase that disallows the loss was often placed earlier by a rule you were not thinking about today.
A gate that only looks at your current holdings will pass a trade it should have blocked. It needs the transaction history for the window, not just a position snapshot.
- A scheduled monthly add that bought the same stock or fund three weeks ago sits inside the backward window.
- A dividend reinvestment buys shares, so check your reinvestment settings before a loss sale.
- A rebalancing buy queued for next week sits inside the forward window and can be rescheduled.
The scope traps that break the check
The check is not only about repurchasing the same ticker in the same account. Publication 550 separately covers buying substantially identical securities, acquiring them in a fully taxable trade, and acquiring a contract or option to buy them (IRS Publication 550: https://www.irs.gov/publications/p550).
An IRA purchase can have a particularly costly result. Revenue Ruling 2008-5 addresses a loss sale in a taxable account followed by a purchase of substantially identical securities in your IRA or Roth IRA, and states that the loss is disallowed and that the basis in the IRA is not increased (IRS Revenue Ruling 2008-5: https://www.irs.gov/pub/irs-drop/rr-08-05.pdf).
That matters because of how the ordinary case works. Publication 550 explains the treatment of a disallowed loss and the basis of the replacement stock or securities in a taxable wash sale, which is the mechanism the IRA case does not give you (IRS Publication 550: https://www.irs.gov/publications/p550).
Publication 550 also says a loss sale can become a wash sale when your spouse or a corporation you control buys substantially identical securities (IRS Publication 550: https://www.irs.gov/publications/p550). Review the accounts and automated purchase plans that could place a related order, and ask a tax professional how the rule applies to your specific account structure.
- Taxable brokerage accounts, including a second brokerage you rarely log into.
- Your IRA and Roth IRA, including automatic purchases inside those accounts.
- A spouse account that could buy the same or a substantially identical holding (IRS Publication 550: https://www.irs.gov/publications/p550).
- Options and contracts that give you a claim on the same shares (IRS Publication 550: https://www.irs.gov/publications/p550).
- Automatic plans such as dividend reinvestment and recurring buys.
Substantially identical is a judgment call, so route around it
No shortcut resolves a given fund pair for you. Publication 550 discusses substantially identical stock or securities, and the IRS also keeps a short question and answer page covering wash sales under stocks, options, splits, and traders (IRS Publication 550: https://www.irs.gov/publications/p550; IRS FAQ, Stocks, Options, Splits, Traders: https://www.irs.gov/faqs/capital-gains-losses-and-sale-of-home/stocks-options-splits-traders).
Read those before you decide two index funds are different enough. If the answer remains uncertain, compare another replacement, wait out the window, or ask a tax professional before you trade.
- Wait out the window and accept the exposure gap.
- Hold cash or a clearly different asset class for the window.
- Skip the harvest entirely when the position is central to your strategy.
Write it as a gate, not a reminder
A reminder depends on you remembering. A gate is a condition the trade has to pass, and it produces a record either way. This is the same pattern Investory uses for its other checks: the rule proposes an action, the research and risk gates decide whether it can proceed, and the receipt shows what happened.
The date, account, transaction, and pending-order checks are mechanical. Deciding whether two securities are substantially identical can require judgment. A useful gate separates those questions and pauses the trade when the judgment call is unresolved.
- What is the sale date, and what are the boundaries of the window around it (IRS Publication 550: https://www.irs.gov/publications/p550)?
- Which accounts were scanned, and did one of them buy the same or a similar holding inside that window?
- Are automatic purchases scheduled that would land inside the forward window?
- What is the replacement plan, and has it been checked against the substantially identical question?
- If a question is left unresolved, does the rule pause instead of selling?
Where rebalancing rules collide with loss harvesting
Loss harvesting and rebalancing pull in different directions. Rebalancing wants to buy what fell, which is often exactly the holding you just sold at a loss. Vanguard research on rebalancing discusses how the choice of rebalancing frequency and threshold involves a tradeoff between risk control and turnover (Vanguard, Getting Back on Track: A Guide to Smart Rebalancing: https://corporate.vanguard.com/content/dam/corp/research/pdf/getting_back_on_track_a_guide_to_smart_rebalancing.pdf).
More turnover means more purchases scattered near your loss sales, which means more chances for the two rules to work against each other. The SEC investor education material on asset allocation, diversification, and rebalancing is a good plain language starting point if you are still setting targets (SEC Investor.gov: https://www.investor.gov/introduction-investing/investing-basics/guiding-principles/asset-allocation-diversification-and).
The resolution is ordering, not cleverness. Decide in advance which rule yields when they conflict, and write that sentence into both rules so neither one silently wins.
- Sequence loss sales ahead of scheduled buys, or pause the buy for the window.
- Turn off reinvestment in the affected holding while the window is open.
- Name the account scope inside the rebalancing rule, not just the tax rule.
What to record so you can review the rule later
The reason to log this is not paperwork. A loss harvesting rule can be evaluated afterward, but only if you kept the inputs.
Keep the record attached to the trade, not in a separate spreadsheet you will stop updating. When a question comes up months later, you want the answer in the same place as the decision.
- Sale date, loss amount, and the boundaries of the window around the sale.
- The list of accounts you scanned and the date you scanned them.
- The replacement decision and the reasoning behind it.
- The rule version that fired and your approval of the trade.