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
- Day of sale: The date you realize the loss
- 30 days before: Purchases in this window can trigger wash sales
- 30 days after: Purchases in this window can trigger wash sales
- Total window: 61 calendar days
📅 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:
- Wash sales match against replacement shares purchased within the window
- If you buy shares before AND after the loss sale, purchases are matched in chronological order
- Partial wash sales can occur if you don't repurchase the full quantity
- Multiple lots can create cascading wash sales
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
- Volume amplification: 1,000+ trades/day = millions of potential wash sale comparisons
- Rolling positions: Continuous trading makes nearly every loss sale a wash sale
- Loss deferrals compound: Disallowed losses stack into basis adjustments across hundreds of lots
- Year-end positions: If you hold positions at year-end, deferred losses remain suspended
- Tracking nightmare: Manual calculation is impossible; sophisticated software required
Real-World HFT Example
⚠ 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
- 475(f) Mark-to-Market Election: Completely exempts you from wash sale rules (see below)
- Trade ETFs instead of individual stocks: Rotate between SPY/VOO/IVV to harvest losses
- 31-day loss harvesting: Wait 31 days before repurchasing (kills HFT strategies)
- Trade futures instead of stocks: Section 1256 contracts have different rules
- Use different accounts carefully: Wash sales apply across all your accounts AND your IRA
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
- Strike price matters: Deep ITM calls are more likely substantially identical to stock
- Expiration date: Same strike but different expiration may avoid wash sale
- LEAPS vs short-term: Long-dated options are more stock-like
- Covered calls: Selling covered calls after realizing a loss can trigger issues
⚠ 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
- Substantially identical determination: Is BTC on Coinbase substantially identical to BTC on Kraken? (Yes)
- Wrapped tokens: Is WBTC substantially identical to BTC? (Unclear, likely yes)
- Different blockchains: Is ETH substantially identical to ETH on Arbitrum? (Gray area)
- Stablecoins: USDC vs USDT vs DAI = likely NOT substantially identical
- DeFi positions: Staked/locked crypto may or may not trigger wash sales
- NFTs: Each NFT is unique; wash sale rules likely don't apply to specific NFTs
Crypto Trading Strategies Post-2025
- Harvest to stablecoins: Sell crypto at loss, wait 31 days before repurchasing
- Rotate similar assets: Sell BTC, buy ETH (not substantially identical)
- 475(f) election: Mark-to-market exemption applies to crypto traders too
- 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
- Every purchase and sale with dates, quantities, and prices
- 61-day window for each loss sale
- Replacement shares purchased in each window
- Disallowed loss amounts for each wash sale
- Adjusted basis of replacement shares (original basis + disallowed loss)
- Holding period adjustments (tacks on holding period of sold shares)
Form 8949 Reporting
Wash sales must be reported on Form 8949 (Sales and Other Dispositions of Capital Assets):
- Column (f): Report the disallowed loss amount
- Code "W" in column (f) indicates wash sale adjustment
- Adjusted gain/loss appears in column (h)
- Each transaction must be reported individually (could be thousands of rows)
⚠ 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:
- Multiple brokerage accounts
- Your spouse's accounts (if filing jointly)
- Traditional and Roth IRAs (see below)
- 401(k) plans with brokerage windows
- Entity accounts you control (single-member LLC, etc.)
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
- Never buy in IRA after selling at loss in taxable (within 61 days)
- Use different securities: If selling AAPL in taxable, buy MSFT in IRA
- Wait 31+ days: If you must repurchase same security, wait outside the window
- Segregate strategies: Trade different assets in IRA vs taxable accounts
- Track religiously: Most brokers don't flag IRA wash sales
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:
- All positions are marked to fair market value on December 31
- Gains and losses are treated as ordinary income/loss (not capital)
- Wash sale rules don't apply
- No $3,000 capital loss limitation
- No long-term capital gains rates (trade-off)
Who Qualifies for 475(f)?
You must first qualify for Trader Tax Status (TTS):
- Trade substantially full-time (typically 4+ hours/day)
- Execute frequent trades (often 4+ trades/day, 15-20+ trades/week)
- Seek to profit from short-term market movements, not long-term appreciation
- Maintain regular, continuous trading throughout the year
📅 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
- High-frequency traders: Wash sale tracking is impossible/impractical
- Traders with losses: Need to deduct more than $3,000/year
- Short-term traders: Most gains already short-term (no loss of preferential rates)
- Professional traders: Trading is your primary business
When to Avoid 475(f)
- You frequently hold positions long-term (lose 0%/15%/20% rates)
- You have large unrealized gains at year-end (will be taxed even if not sold)
- You're not sure you qualify for TTS (election is hard to revoke)
- You trade irregularly or part-time
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
- Multi-broker import: Aggregate trades from all your accounts
- Cross-account wash sale detection: Track wash sales across brokers
- IRA coordination: Flag potential IRA wash sale black holes
- Real-time tracking: Monitor wash sale impact before year-end
- Tax-lot optimization: Suggest which lots to sell to minimize wash sales
- Form 8949 generation: Export directly to tax software
- Audit trail: Detailed documentation for IRS examination
💡 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:
- Spreadsheet approach: Track every trade with date, symbol, quantity, price
- 61-day window calculation: For each loss sale, check +/- 30 days for purchases
- Basis adjustment tracking: Add disallowed losses to replacement share basis
- 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
Action Plan for Traders
Immediate Steps
- Assess your current exposure: Use the calculator above to estimate wash sale impact
- Get tracking software: Don't wait until January; set up now
- Review year-to-date trades: Understand how many wash sales you've already triggered
- Consider 475(f) election: If you qualify for TTS, this may solve your problems
Before Year-End Strategy
- Strategic loss harvesting: Plan loss sales with 31-day gaps
- Close problematic positions: Consider exiting positions to reset basis
- Avoid IRA purchases: Never buy in IRA what you sold at loss in taxable (61-day rule)
- Document everything: Maintain detailed records for audit defense
Long-Term Solutions
- 475(f) Mark-to-Market Election: File by April 15 for next year (completely eliminates wash sales)
- Modify trading strategy: Trade different but correlated assets (SPY/VOO rotation)
- Segment accounts: Use different securities in taxable vs IRA accounts
- 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.