Wash Sale Rule: Algorithmic Trading

📅 Updated Dec 2025 ⏱ 15 min read 💰 Tax Compliance

IRC Section 1091 Overview

The wash sale rule under IRC Section 1091 prevents taxpayers from claiming a tax deduction for a security sold at a loss if they purchase a "substantially identical" security within 30 days before or after the sale date (a 61-day window total).

For algorithmic traders executing hundreds or thousands of trades per day, wash sale rules create a massive compliance burden and can dramatically increase your tax liability—even if you had net losses for the year.

⚠ Critical for Algo Traders

Wash sales can turn a profitable trading year into a tax disaster. Disallowed losses get deferred, but if you stop trading that security, those losses may become permanently non-deductible. High-frequency traders face exponential wash sale tracking complexity.

The Problem Illustrated

Date Transaction Price Gain/Loss Wash Sale?
Jan 5 Buy 100 AAPL $150
Jan 10 Sell 100 AAPL $145 ($500) Yes (repurchased Jan 15)
Jan 15 Buy 100 AAPL $143 Triggers wash sale
Result: $500 loss is disallowed and added to basis of Jan 15 purchase

The 61-Day Window (30 Before/30 After)

The wash sale rule applies to a 61-day period: 30 days before the loss sale + the sale date + 30 days after.

How the Window Works

📅 Calendar Days, Not Trading Days

The 61-day window counts calendar days, not trading days. Weekends and holidays count toward the 30-day periods before and after the loss sale.

Complex Scenario: Multiple Purchases

When you make multiple purchases within the 61-day window, the IRS applies wash sale rules using FIFO (First-In-First-Out) matching by default, but the actual rules are more complex:

Substantially Identical Securities

The wash sale rule only applies when you repurchase a "substantially identical" security. The IRS has not provided a comprehensive definition, but guidance exists:

Clear Substantially Identical

✓ Same Stock

AAPL sold and repurchased = substantially identical

✓ Same Company, Different Class

GOOG (Class C) vs GOOGL (Class A) = generally identical

✓ Convertible Securities

Bonds convertible to stock may be substantially identical to the stock

✓ Call Options (In-the-Money)

Selling stock at a loss and buying deep ITM calls may trigger wash sale

NOT Substantially Identical

✗ Different Companies (Same Sector)

JPM vs BAC = different securities, even if correlated

✗ ETFs Tracking Same Index

SPY vs VOO = IRS has ruled these are NOT substantially identical

✗ Bonds (Different Issuers/Terms)

10-year Treasury vs 30-year Treasury = different securities

✗ Preferred vs Common Stock

Generally not substantially identical (unless convertible)

⚠ Gray Areas

Options, futures, and complex derivatives exist in a gray area. The IRS has issued limited guidance. Conservative approach: assume wash sale rules apply to economically similar positions.

High-Frequency Trading Wash Sales

High-frequency and algorithmic traders face unique wash sale challenges due to the sheer volume and speed of trades:

The Compounding Problem

  1. Volume amplification: 1,000+ trades/day = millions of potential wash sale comparisons
  2. Rolling positions: Continuous trading makes nearly every loss sale a wash sale
  3. Loss deferrals compound: Disallowed losses stack into basis adjustments across hundreds of lots
  4. Year-end positions: If you hold positions at year-end, deferred losses remain suspended
  5. Tracking nightmare: Manual calculation is impossible; sophisticated software required

Real-World HFT Example

Algo Trader Statistics (2025): • Total trades: 45,000 • Symbols traded: 150 • Gross profit: $250,000 • Gross loss: $220,000 • Net P&L: $30,000 Wash Sale Impact: • Loss sales: 22,000 • Wash sales triggered: 18,500 (84%) • Disallowed losses: $195,000 • Deferred to next year: $175,000 (held positions) • Permanently lost: $20,000 (stopped trading certain symbols) Tax Consequence: • Taxable gain WITHOUT wash sale adjustment: $30,000 • Taxable gain WITH wash sale disallowance: $225,000 • Additional tax owed (37% bracket): ~$72,000 • Actual cash profit: $30,000

⚠ Insolvency Risk

HFT traders can owe more in taxes than they made in actual profits. This has bankrupted traders who didn't understand wash sale implications. You can have a small net gain but owe six figures in taxes due to disallowed losses.

HFT Wash Sale Mitigation Strategies

Options & Wash Sales

Options and stock interactions for wash sale purposes are complex and not fully settled by IRS guidance:

General Rules

Scenario Wash Sale Risk IRS Position
Sell stock at loss, buy same stock call option High Likely triggers wash sale if deep ITM
Sell stock at loss, sell put option High Cash-secured put = substantially identical position
Sell call option at loss, buy same call High Same strike/expiration = substantially identical
Sell call option at loss, buy different strike Moderate Gray area; depends on how similar
Sell stock at loss, buy OTM call Low-Moderate Unclear; conservative approach assumes risk

Options-Specific Considerations

⚠ Conservative Approach Recommended

Due to limited IRS guidance on options wash sales, take a conservative approach. Assume any economically similar option position could trigger wash sale rules. Document your reasoning if you take an aggressive position.

Crypto Wash Sales (Post-2025)

Prior to 2025, cryptocurrencies were NOT subject to wash sale rules because the IRS treated them as property, not securities. Section 1091 only applies to "stocks or securities."

📅 2025 Tax Law Change

The Infrastructure Investment and Jobs Act (enacted 2021, effective 2025) extended wash sale rules to digital assets, including cryptocurrencies. Starting with 2025 tax year, crypto trades ARE subject to wash sale rules.

What Changed for Crypto (2025+)

Aspect Before 2025 2025 and After
Wash Sale Rules Apply? No Yes
Tax Loss Harvesting Unrestricted 61-day window restrictions
Same-Day Buy/Sell Both transactions count Loss may be disallowed
Cross-Exchange Trading No restrictions All accounts aggregated

Crypto-Specific Complications

Crypto Trading Strategies Post-2025

  1. Harvest to stablecoins: Sell crypto at loss, wait 31 days before repurchasing
  2. Rotate similar assets: Sell BTC, buy ETH (not substantially identical)
  3. 475(f) election: Mark-to-market exemption applies to crypto traders too
  4. Strategic timing: Plan loss harvesting around year-end with 31-day gaps

Tracking & Reporting Burden

Wash sale tracking and reporting requirements are substantial, especially for active traders:

What You Must Track

Form 8949 Reporting

Wash sales must be reported on Form 8949 (Sales and Other Dispositions of Capital Assets):

⚠ Broker Reporting Limitations

Brokers are required to track and report wash sales on Form 1099-B, BUT only for identical securities within the same account. Brokers DO NOT track wash sales across multiple accounts, between brokers, or with IRAs. You must track these yourself.

Cross-Account Tracking

Wash sale rules apply across ALL your accounts:

IRA Wash Sale Coordination

One of the most dangerous wash sale traps involves IRAs:

⚠ IRA Wash Sale Black Hole

If you sell a security at a loss in your taxable account and repurchase it in your IRA within 61 days, the loss is PERMANENTLY DISALLOWED. You cannot deduct it, and you cannot add it to the basis of the IRA shares (IRAs don't have cost basis for tax purposes).

How the IRA Trap Works

Date Account Transaction Result
Nov 15 Taxable Sell 100 AAPL at $10,000 loss Loss realized
Nov 20 IRA Buy 100 AAPL Wash sale triggered
Result: $10,000 loss permanently disallowed (cannot be added to IRA basis)

IRA Best Practices

475(f) Mark-to-Market Exemption

The Section 475(f) mark-to-market election is the most powerful solution to wash sale rules for qualifying traders:

✓ Complete Wash Sale Exemption

Traders who make the 475(f) election are completely exempt from wash sale rules. IRC Section 475(d) specifically excludes mark-to-market traders from Section 1091.

How 475(f) Works

Under the mark-to-market election:

Who Qualifies for 475(f)?

You must first qualify for Trader Tax Status (TTS):

📅 Election Deadline

The 475(f) election must be made by the due date (without extensions) of the prior year's tax return. For 2026 election, you must file by April 15, 2026. Late elections are generally not permitted.

475(f) vs Regular Treatment Comparison

Tax Treatment Comparison

Feature Regular (Capital Gains) 475(f) Mark-to-Market
Wash Sale Rules Apply (major burden) Do NOT apply
Loss Limitation $3,000/year cap Unlimited deduction
Tax Rate on Gains 0%/15%/20% (long-term) Ordinary rates (up to 37%)
Year-End Positions No tax until sold Taxed as if sold Dec 31
Loss Carryforward Indefinite (capital loss) 2-year NOL carryforward
Business Expense Deductions Limited (2% AGI floor, eliminated) Full Schedule C deductions
Self-Employment Tax None Generally none (trading isn't SE activity)

When 475(f) Makes Sense

  1. High-frequency traders: Wash sale tracking is impossible/impractical
  2. Traders with losses: Need to deduct more than $3,000/year
  3. Short-term traders: Most gains already short-term (no loss of preferential rates)
  4. Professional traders: Trading is your primary business

When to Avoid 475(f)

See our complete guide: Section 475(f) Mark-to-Market Election

Software Solutions

Given the complexity of wash sale tracking, specialized software is essential for active traders:

Leading Tax Software for Traders

Software Features Best For Price Range
TradeLog Wash sale tracking, multi-account, imports from 100+ brokers, Form 8949 generation Active stock/options traders $199-$599/year
GainsKeeper Real-time wash sale tracking, tax-lot optimization, multi-asset support Stocks, bonds, mutual funds $199-$499/year
CryptoTrader.Tax Crypto-specific wash sales (post-2025), DeFi tracking, NFTs Crypto traders $49-$299/year
TokenTax Crypto wash sales, exchange imports, staking income Crypto/DeFi traders $65-$500/year
TradeStation Tax Center Built into broker platform, automatic wash sale adjustments TradeStation customers Free with account
Interactive Brokers Reports Comprehensive tax reports, wash sale tracking within IB accounts IB customers Free with account

Key Software Features to Look For

💡 Pro Tip: Test Before Year-End

Don't wait until tax season to set up wash sale tracking software. Import your trades mid-year to identify problems early. You may be able to adjust your strategy to minimize wash sale impact before December 31.

Manual Tracking Methods (Not Recommended for HFT)

For traders with low volume (under 100 trades/year), manual tracking is possible:

  1. Spreadsheet approach: Track every trade with date, symbol, quantity, price
  2. 61-day window calculation: For each loss sale, check +/- 30 days for purchases
  3. Basis adjustment tracking: Add disallowed losses to replacement share basis
  4. Form 8949 preparation: Report each transaction with Code W adjustments

Reality check: Manual tracking breaks down quickly beyond ~50 trades. For algorithmic/HFT traders with thousands of trades, manual tracking is impossible.

Wash Sale Impact Calculator

Wash Sale Tax Impact Calculator

Estimate how wash sales affect your tax liability

Tax Impact Analysis

Net Trading Gain/Loss (Before Wash Sales): $0
Total Wash Sale Losses: $0
Disallowed & Deferred: $0
Permanently Lost (stopped trading): $0
Adjusted Taxable Trading Income: $0
Total Taxable Income: $0
Additional Tax Due to Wash Sales: $0
Calculator Note: This calculator provides estimates only. Actual tax impact depends on your complete tax situation, filing status, deductions, and other factors. Consult a tax professional for personalized advice.

Action Plan for Traders

Immediate Steps

  1. Assess your current exposure: Use the calculator above to estimate wash sale impact
  2. Get tracking software: Don't wait until January; set up now
  3. Review year-to-date trades: Understand how many wash sales you've already triggered
  4. Consider 475(f) election: If you qualify for TTS, this may solve your problems

Before Year-End Strategy

Long-Term Solutions

  1. 475(f) Mark-to-Market Election: File by April 15 for next year (completely eliminates wash sales)
  2. Modify trading strategy: Trade different but correlated assets (SPY/VOO rotation)
  3. Segment accounts: Use different securities in taxable vs IRA accounts
  4. Professional tax help: Work with CPA experienced in trader taxation

💡 Best Practice Summary

For HFT/Algo Traders: The 475(f) election is nearly always the right answer. Wash sale tracking is impractical, and the tax consequences can be catastrophic. If you trade frequently enough to qualify for TTS, make the election.

Disclaimer: This guide provides general information about wash sale rules and tax strategies. Tax law is complex and your situation may differ significantly. The calculator provides estimates only and should not be relied upon for tax filing. Consult a qualified tax professional (CPA or tax attorney) experienced in trader taxation before making any tax elections or implementing tax strategies. This is not legal or tax advice.