5.4 Tax-Loss Harvesting, Wash-Sale Rules & Direct Indexing

Key Takeaways

  • Tax-loss harvesting converts unrealized paper losses into realized capital losses to offset realized capital gains dollar-for-dollar, plus up to $3,000 of ordinary income annually, with unused losses carrying forward indefinitely under IRC §1212.
  • Under IRC §1091, the Wash-Sale Rule disallows a realized loss if a taxpayer acquires 'substantially identical' stock or securities (or enters into a contract/option to acquire) within a 61-day window (30 days before, trade date, 30 days after).
  • Disallowed wash-sale losses are added to the cost basis of the replacement security, and the holding period of the original security is tacked onto the replacement security under IRC §1223(4).
  • Under IRS Revenue Ruling 2008-5, purchasing substantially identical securities inside an IRA or Roth IRA within the 61-day window triggers the wash-sale rule and permanently destroys the tax loss with zero basis adjustment.
  • Direct indexing holds individual constituent stocks of an index in a Separately Managed Account (SMA), harvesting losses on declining individual constituents regardless of broader market direction and generating 100 to 200+ bps of annual tax alpha.
Last updated: August 2026

5.4 Tax-Loss Harvesting, Wash-Sale Rules & Direct Indexing

Tax-loss harvesting is a core quantitative technique utilized by private wealth advisors to enhance after-tax portfolio returns. By systematically harvesting capital losses during market volatility, advisors offset realized capital gains across the client's balance sheet (including private business sales, real estate exits, and private equity distributions) and build an enduring bank of capital loss carryforwards. However, advisors must navigate strict statutory wash-sale rules under IRC §1091 and understand the institutional power of Direct Indexing.


1. Capital Gain and Loss Netting Mechanics (IRC §1222)

The Internal Revenue Code establishes a strict, sequential five-step netting process for capital gains and losses realized during a tax year:

   ┌────────────────────────────────────────────────────────────────────────┐
   │                Sequential Capital Loss Netting Hierarchy               │
   ├────────────────────────────────────────────────────────────────────────┤
   │ Step 1: Net Short-Term Capital Gains against Short-Term Capital Losses │
   │         -> Results in Net Short-Term Capital Gain or Loss              │
   │                                                                        │
   │ Step 2: Net Long-Term Capital Gains against Long-Term Capital Losses   │
   │         -> Results in Net Long-Term Capital Gain or Loss               │
   │                                                                        │
   │ Step 3: Cross-Net Net Short-Term against Net Long-Term                 │
   │         • Net Short-Term Gain + Net Long-Term Gain -> Taxed Separately │
   │         • Net Short-Term Loss + Net Long-Term Gain -> Offset ST vs LT  │
   │         • Net Long-Term Loss + Net Short-Term Gain -> Offset LT vs ST  │
   │                                                                        │
   │ Step 4: Net Capital Loss Offset Against Ordinary Income                │
   │         • Excess net capital losses offset up to $3,000 of ordinary    │
   │           income per tax year ($1,500 for Married Filing Separately)   │
   │                                                                        │
   │ Step 5: Indefinite Carryforward (IRC §1212(b))                         │
   │         • Remaining unused losses retain their Short-Term / Long-Term  │
   │           character and carry forward indefinitely until death.        │
   └────────────────────────────────────────────────────────────────────────┘

Tax Arbitrage in Netting

The highest value of tax-loss harvesting occurs when a taxpayer uses long-term capital losses to offset short-term capital gains (which would otherwise be taxed at ordinary rates up to 40.8%) or uses harvested losses to offset up to $3,000 of ordinary income annually.


2. The IRC §1091 Wash-Sale Rule

The Wash-Sale Rule under IRC §1091 prevents taxpayers from claiming an artificial tax loss while maintaining an uninterrupted economic position in a security.

The 61-Day Prohibited Window

A wash sale occurs if a taxpayer sells a stock or security at a loss and, within a 61-day window spanning 30 calendar days before the sale, the date of the sale, and 30 calendar days after the sale, the taxpayer acquires or enters into a contract or option to acquire substantially identical stock or securities.

   ┌────────────────────────────────────────────────────────────────────────┐
   │                   The 61-Day Wash-Sale Timeline Window                 │
   ├───────────────────────────────┬──────────────┬─────────────────────────┤
   │       30 DAYS PRIOR           │  TRADE DATE  │       30 DAYS AFTER     │
   ├───────────────────────────────┼──────────────┼─────────────────────────┤
   │ Purchasing identical security │ Sell at Loss │ Purchasing identical    │
   │ triggers wash sale on sale    │ (Trigger)    │ security disallows loss │
   └───────────────────────────────┴──────────────┴─────────────────────────┘

Cost Basis & Holding Period Adjustments

When a wash sale occurs in a taxable account, the loss is not permanently lost; rather, it is deferred:

  1. Disallowance: The realized loss is disallowed as a current-year tax deduction.
  2. Basis Increase (IRC §1091(d)): The disallowed loss is added to the cost basis of the newly acquired replacement shares.
  3. Holding Period Tacking (IRC §1223(4)): The holding period of the sold shares is added (tacked) to the holding period of the replacement shares.
Loading diagram...
Wash-Sale Basis Adjustment Mechanics (Taxable Account)

3. Defining "Substantially Identical" Securities

Neither the Internal Revenue Code nor Treasury Regulations provide an exhaustive definition of "substantially identical," but decades of IRS Revenue Rulings and Tax Court decisions establish clear operating principles:

Substantially Identical vs. Non-Identical Matrix

Sold SecurityReplacement SecuritySubstantially Identical?Wash Sale Triggered?Key Regulatory / Tax Rationale
Apple Common Stock (AAPL)Apple Common Stock (AAPL)YESYESIdentical legal equity of same issuer.
Apple Common Stock (AAPL)Apple Call Option (Call on AAPL)YESYESIRC §1091(a) explicitly includes contracts or options to acquire stock.
ExxonMobil (XOM)Chevron (CVX)NONODifferent corporate issuers, different balance sheets, different management.
SPDR S&P 500 ETF (SPY)iShares Core S&P 500 ETF (IVV)HIGH RISK / YESLIKELYIdentical underlying index, identical 500 holdings, near-perfect correlation (0.999+).
SPDR S&P 500 ETF (SPY)Vanguard Large-Cap ETF (VV - CRSP Index)NONODifferent tracking index (CRSP US Large Cap vs S&P 500), different constituent rules.
SPDR S&P 500 ETF (SPY)Vanguard Total Stock Market (VTI)NONOS&P 500 large-cap vs total market containing ~3,500 mid/small caps.
Invesco QQQ (Nasdaq 100)iShares Semiconductor ETF (SOXX)NONOBroad tech/comm index vs concentrated sector semiconductor basket.

4. Cross-Account and Spousal Wash-Sale Traps

A critical area of exam testing and advisory practice is the application of wash-sale rules across multiple accounts:

1. Multiple Taxable & Spousal Accounts

Wash-sale rules apply across all accounts owned or controlled by the taxpayer and their spouse. If a husband sells Microsoft stock at a loss in his individual account, and his wife purchases Microsoft stock within 30 days in her separate individual account or a joint account, the wash-sale rule is triggered.

2. The Fatal IRA Wash-Sale Trap (IRS Revenue Ruling 2008-5)

In Revenue Ruling 2008-5, the IRS addressed the scenario where a taxpayer sells stock at a loss in a taxable brokerage account and, within 30 days, purchases substantially identical stock inside their Traditional IRA or Roth IRA:

  • The Loss Is Permanently Disallowed: The loss cannot be claimed on the individual Form 1040.
  • No Basis Adjustment Permitted: Because IRAs do not track cost basis in underlying assets, the disallowed loss cannot be added to the IRA basis.
  • Catastrophic Outcome: The tax loss deduction is permanently destroyed with zero offsetting tax benefit!

5. Direct Indexing & Tax Alpha Generation

Direct Indexing represents the modern evolution of tax-loss harvesting for high-net-worth investors. Instead of purchasing a commingled ETF or mutual fund (e.g., SPY or VOO), the client establishes a Separately Managed Account (SMA) that directly owns hundreds of individual constituent equities (e.g., 300 to 500 individual stocks representing the S&P 500 or Russell 3000).

   ┌────────────────────────────────────────────────────────────────────────┐
   │                   Direct Indexing Tax Alpha Mechanics                  │
   ├────────────────────────────────────────────────────────────────────────┤
   │ Scenario: S&P 500 Index is UP +10% during a volatile year.             │
   │                                                                        │
   │ • Commingled ETF Investor (SPY):                                       │
   │   - SPY is up +10%. Realized harvestable losses = $0.                  │
   │                                                                        │
   │ • Direct Indexing SMA Investor (Individual Stock Holdings):            │
   │   - 350 stocks are UP +20% (Unrealized gains kept invested)            │
   │   - 150 stocks are DOWN -15% (Losses systematically HARVESTED!)        │
   │   - Reinvest harvested cash into correlated proxy stocks               │
   │   - Benchmark tracking error maintained (< 0.50%)                      │
   │                                                                        │
   │ Result: Generates 100 to 200+ bps of Tax Alpha against outside gains!  │
   └────────────────────────────────────────────────────────────────────────┘

Embedded Gain Management in Legacy Portfolios

When an HNW client joins an advisory firm with a legacy portfolio containing concentrated, highly appreciated individual stocks (e.g., $5M in Apple with a $500k basis), selling everything immediately triggers a massive capital gains tax bill. Direct indexing allows the advisor to:

  1. Keep the low-basis concentrated stock in the SMA.
  2. Build a customized direct index around the concentrated holding (excluding tech/Apple from the benchmark to avoid over-concentration).
  3. Use harvested losses from other direct index constituents over 3–5 years to systematically eliminate the concentrated position at zero net tax cost.
Test Your Knowledge

An investor sells 500 shares of stock at a realized capital loss of $15,000 in a taxable individual brokerage account on October 10. On October 25 (15 days later), the investor purchases 500 shares of the identical stock inside their Roth IRA. What is the tax consequence under IRS Revenue Ruling 2008-5?

A
B
C
D
Test Your Knowledge

A wealth advisor is implementing a systematic tax-loss harvesting strategy for a taxable client who holds the SPDR S&P 500 ETF (SPY) at a significant unrealized loss. To avoid violating the IRC §1091 Wash-Sale Rule while maintaining continuous broad equity market exposure, which replacement security should the advisor recommend?

A
B
C
D
Test Your Knowledge

How does Direct Indexing generate substantial 'tax alpha' (100 to 200+ bps annually) for a high-net-worth investor even during calendar years when the broad market index experiences positive total returns?

A
B
C
D