Skip to content

Tax Analysis

Taxes are the hidden cost that most backtesting platforms ignore entirely. A strategy might show a 20% annual return before taxes but only deliver 12% after taxes — and those 8 percentage points matter enormously for long-term compounding.

Stratifyre includes a full US tax analysis engine that calculates the actual after-tax impact of your strategy, including short-term vs. long-term capital gains classification, Section 1256 treatment for futures, wash sale detection, and multiple tax lot optimization methods.

Two strategies with identical pre-tax returns can have very different after-tax results:

  • Strategy A trades frequently, holding positions for days. All gains are taxed as short-term capital gains at your ordinary income tax rate (potentially 37% at the top federal bracket).
  • Strategy B holds positions for months, qualifying most gains as long-term capital gains (taxed at 15-20% for most taxpayers).

Over 10 years, the compounding difference is substantial. Tax analysis helps you understand this difference and potentially adjust your strategy to be more tax-efficient — without sacrificing too much pre-tax performance.

The IRS classifies capital gains based on how long you held the asset:

  • Short-term gains — positions held for one year or less. Taxed at your ordinary income tax rate, which can be as high as 37%.
  • Long-term gains — positions held for more than one year. Taxed at preferential rates: 0%, 15%, or 20% depending on your income level.

Stratifyre automatically classifies every trade in your backtest as short-term or long-term based on the actual holding period. The results page shows:

  • Total short-term gains and losses.
  • Total long-term gains and losses.
  • Net tax liability at each bracket.
  • The effective tax rate for the overall strategy.

US tax brackets change from year to year. Stratifyre uses the actual historical tax brackets for each year in your backtest, not just today’s rates. A backtest spanning 2005 to 2025 applies the correct bracket schedules for each year, including changes from major tax legislation.

This means the tax impact shown is historically accurate — not an approximation based on current rates.

Futures contracts traded on US exchanges receive special tax treatment under Section 1256 of the Internal Revenue Code. Regardless of how long you held the position, gains and losses are taxed using the 60/40 rule:

  • 60% of gains are treated as long-term capital gains (lower rate).
  • 40% of gains are treated as short-term capital gains (higher rate).

This is a significant advantage for active futures traders. A day trader in futures pays a blended tax rate that is substantially lower than what the same trading frequency would incur in equities.

Stratifyre automatically applies Section 1256 treatment to eligible futures contracts (CME, CBOT, NYMEX, COMEX, ICE). You do not need to configure anything — the engine detects the instrument type and applies the correct tax rule.

The wash sale rule is one of the most complex areas of US tax law for active traders. It prevents you from claiming a tax loss if you repurchase a “substantially identical” security within 30 days before or after the sale.

  1. You sell Stock XYZ at a $1,000 loss on March 15.
  2. You buy Stock XYZ again on April 1 (within 30 days).
  3. The $1,000 loss is disallowed — you cannot deduct it on your taxes this year.
  4. Instead, the disallowed loss is added to the cost basis of the new position.
  5. If you later sell the new position at a gain, the disallowed loss effectively reduces that gain.

The engine scans every trade in your backtest for wash sale violations, checking both the 30-day look-back and look-forward windows. When a wash sale is detected:

  • The disallowed loss is flagged in the trade log.
  • The cost basis of the replacement purchase is adjusted upward by the disallowed amount.
  • The tax analysis reflects the actual deductible losses (after wash sale adjustments), not the gross losses.

This is critical for strategies that trade the same instrument frequently. A mean-reversion strategy that buys and sells the same stock every few days might trigger dozens of wash sales per year, dramatically changing the tax picture.

When you sell shares of a stock that you purchased at different times and prices, you need to determine which specific shares you are selling. This affects your gain/loss calculation and, consequently, your tax bill. Stratifyre supports three tax lot identification methods:

The oldest shares are sold first. This is the IRS default method if you do not specify otherwise.

Tax implication: In a rising market, FIFO tends to sell the cheapest shares first, resulting in larger gains and higher taxes. In a falling market, it sells the more expensive shares first, generating losses earlier.

The most recently purchased shares are sold first.

Tax implication: In a rising market, LIFO sells the most expensive (recently purchased) shares first, resulting in smaller gains and lower taxes. However, gains are more likely to be short-term (taxed at higher rates) since you are selling recent purchases.

You choose exactly which shares to sell. Stratifyre optimizes this selection to minimize your tax bill.

Tax implication: This is the most tax-efficient method because the engine can strategically select lots to:

  • Harvest losses (sell losing lots to offset gains elsewhere).
  • Prioritize long-term gains (sell lots held over one year).
  • Balance short-term and long-term gains to stay in lower brackets.

One of the most powerful features of Stratifyre’s tax analysis is the after-tax equity curve. This shows your account’s growth after accounting for taxes owed each year.

At the end of each tax year in the backtest, the engine calculates:

  1. Total realized short-term gains and losses (after wash sale adjustments).
  2. Total realized long-term gains and losses.
  3. Dividend income.
  4. The net tax liability based on the applicable bracket schedule and tax lot method.
  5. The tax owed is deducted from the account balance.

The resulting equity curve shows your actual after-tax wealth accumulation — the money you get to keep.

The results page displays both the pre-tax and after-tax equity curves overlaid on the same chart. The gap between the two lines represents the cumulative tax drag.

What to look for:

  • The size of the gap. A large and growing gap means taxes are significantly eroding your returns. Consider whether holding positions longer (to qualify for long-term rates) or switching to futures (Section 1256 treatment) could narrow this gap.
  • The gap’s growth rate. If the gap accelerates over time, compounding is working against you — taxes are reducing the capital base that generates future returns.
  • Year-end jumps. The after-tax curve drops at the end of each year when taxes are “paid.” Large drops indicate years with heavy tax liability.

The tax analysis section includes a detailed annual tax report showing:

Report Item Description
Gross short-term gains Total gains from positions held one year or less
Gross long-term gains Total gains from positions held more than one year
Wash sale adjustments Total losses disallowed under the wash sale rule
Net short-term gain/loss After wash sale adjustments
Net long-term gain/loss After wash sale adjustments
Section 1256 gains Futures gains with 60/40 split applied
Dividend income Qualified and non-qualified dividends
Estimated federal tax Based on the applicable year’s bracket schedule
Effective tax rate Total tax as a percentage of total gains
After-tax return Net return after all taxes

Using Tax Analysis to Optimize Your Trading

Section titled “Using Tax Analysis to Optimize Your Trading”

Tax analysis is not just a reporting tool — it can actively inform your strategy design:

If your strategy’s average trade duration is 11 months, extending it to 13 months could shift gains from short-term to long-term rates, saving 15-20 percentage points in taxes on those gains. The pre-tax performance might be slightly lower, but the after-tax performance could be higher.

If your strategy naturally generates some losing trades, the timing of those losses matters. Losses realized in years with large gains offset those gains and reduce taxes. The tax lot method (especially Specific Identification) can help optimize this.

The same strategy logic applied to futures vs. equities can have very different after-tax results due to Section 1256 treatment. For high-frequency strategies, futures may be substantially more tax-efficient.

Every round-trip trade in a short-term window creates a short-term gain or a potential wash sale. Reducing trade frequency (even slightly) can have outsized tax benefits. Compare the after-tax equity curves of a strategy that trades daily versus one that trades weekly to see the impact.

  • Always review the after-tax equity curve alongside the pre-tax results. A strategy is only as good as the money you get to keep.
  • Compare tax lot methods. Specific Identification often produces the best after-tax results, but FIFO and LIFO may be more practical for live trading depending on your broker.
  • Watch for wash sales. If your strategy triggers many wash sales, consider whether slight modifications to the trade timing could avoid them without hurting pre-tax performance.
  • Consider the whole picture. Tax optimization should not override a strategy’s fundamental edge. A slightly less tax-efficient strategy with a much stronger pre-tax return will usually win in the long run.
  • Consult a professional. Stratifyre’s tax analysis is a planning and estimation tool. For actual tax filing, work with a qualified tax advisor who can account for your complete financial situation.