We Open-Sourced a TALS Simulator: Why More Harvested Losses Don't Mean More Wealth
In one synthetic zero-alpha simulation, a 250/150 book harvested 7.2x the losses of long-only and ended $427k behind it in median after-tax wealth. Here is why.
Every number in this article comes from a synthetic Monte Carlo simulation you can rerun yourself: talsim v0.4, 200 common paths for the leverage sweep and 100 per scenario, seed 7, zero manager alpha unless labeled otherwise. These are research results conditional on stated assumptions, and none of them is a forecast of any real strategy's performance.
Tax-aware long-short strategies pitch a simple-sounding trade: add short positions and leverage to a taxable portfolio, and the extra trading generates far more realized losses to harvest. The pitch is arithmetically true. In our simulation, a 250/150 book (which the margin model scales to roughly 233/133; more on that below) realized 7.2 times the gross losses of a long-only harvesting portfolio. It also finished the decade a median $427,000 poorer than that long-only portfolio on the same market paths, and beat it on 19% of them.
Both facts fit in one sentence because they are answers to different questions. Gross harvested losses measure activity. After-tax terminal wealth measures what you keep. Between the two sit wash sales, netting rules, loss-usability limits, financing and borrow costs, turnover, active risk, margin requirements, and the liquidation tax bill at the end. We built an open-source simulator, talsim, to make that entire chain of accounting visible, and this article walks through what it shows.1
This is the reproducible companion to our TALS primer, which covers what these strategies are, the research case for them, and who should consider them. Here we run the machine.
Five different numbers that all get called tax alpha
Marketing materials for loss-harvesting strategies tend to quote one impressive number. The simulator forces five apart, and the article keeps them apart:
- Gross losses realized. Every deductible dollar of realized loss, before anything nets against it. This is the number that scales dramatically with leverage. (Losses the wash-sale rule disallows are tracked separately; their value moves into replacement-share basis rather than vanishing.)
- Net realized result. What survives after the portfolio's own realized gains eat their share. A high-turnover book realizes gains too; in our baseline the moderate books realized net gains over the decade while the heavily levered ones carried net losses into liquidation.
- Tax benefit used. The modeled federal tax saved under the configured rates and outside-gain schedule: losses offsetting outside gains, plus the $3,000-per-year ordinary-income deduction.7 A loss that offsets nothing this year is a carryforward, an interest-free IOU from your future tax returns, worth less than the same loss used today.
- Deferral. Tax postponed rather than avoided, mostly by declining to realize gains. Krasner and Sosner showed this quiet mechanism, deferring short-term gains on long positions, supplies a surprising share of TALS tax benefits.4
- Liquidation tax. The bill when the strategy ends and deferred gains come due. In Goldberg, Cai, and Schneider's 130/30 model, liquidation cuts pre-liquidation tax alpha roughly in half.5
The experiment
The baseline run holds everything constant except leverage. Five books, from long-only to 250/150, traded on the same 200 simulated market paths (common random numbers, so every book faces the same sampled shocks; that removes draw-to-draw noise from the comparison and leaves sampling and model uncertainty in place):
- $1,000,000 starting capital, 10 years, 36 synthetic stocks;
- quarterly rebalancing and loss harvesting, lot-level HIFO;
- wash-sale rules enforced in the accounting ledger itself, both window directions, with disallowed losses moved into replacement basis, and a trading policy that avoids washes by substituting names rather than repurchasing what it just harvested;
- $100,000 per year of outside short-term gains for the losses to offset;
- top 2026 federal rates including NIIT (40.8% short-term, 23.8% long-term), no state tax; dividends taxed annually as qualified or ordinary income and excluded from capital-gain netting, so a net capital loss reaches ordinary income only through the annual $3,000 deduction ($1,500 married filing separately);
- 45 bps management fee, 75 bps stock borrow, 5 bps per dollar traded, payments in lieu of dividends on the short book, and 6% debit interest on any negative cash;
- maintenance margin at FINRA Rule 4210 floor levels, with a breach forcing real deleveraging;9
- zero manager alpha, and full liquidation in year 10.
Zero alpha is the assumption everything else stands on, so it is worth a sentence. AQR's own researchers, publishers of the flagship TALS literature, are blunt that tracking error and leverage are only worth taking to the extent they buy expected pre-tax alpha, and that TALS did not evolve as an upgrade to direct indexing.3 Setting expected alpha to zero isolates the strategy from any assumption of profitable stock selection; the differences that remain still include active risk, trading, financing, tax timing, and sequence effects. With any positive alpha baked in, a leverage comparison silently becomes an alpha bet.
One note on method integrity: this simulator has been through three rounds of adversarial line-by-line code review, each a separate AI model prompted to attack the accounting. The first found five accounting and execution defects, the worst of which let harvested losses be repurchased the same day without wash-sale disallowance; the second found that partial wash-sale matches corrupted replacement lots and that payments in lieu ignored the 45-day capitalization boundary; the third found that a step-rounded wash window was disallowing legal 91-day repurchases and inflating the leverage penalty itself. Each round produced a correctness release with regression tests, the discarded numbers are documented in the changelog, the property-based suite caught a further short-side basis error on its first run, and official results are generated in pinned CI with full provenance manifests. Every figure here comes from that corrected, CI-generated run. None of it amounts to a formal software or tax audit.1
What leverage bought, and what it cost
Median after-tax terminal wealth declines at every step up the leverage ladder: $1.62M long-only, $1.50M at 130/30, $1.40M at 150/50, $1.26M at 200/100, $1.13M at 250/150. That last book compounded at 1.3% per year after tax over a decade in which the long-only book compounded at 4.9%, and its 10th-percentile outcome is $638,000. Paired comparisons on common paths make it concrete: 130/30 trailed long-only by a median $118,000 and beat it on 29% of paths; 250/150 trailed by $427,000 and beat it on 19%. Bootstrap 95% intervals on those medians run from about $81,000 to $142,000 behind for 130/30 and $353,000 to $497,000 behind for 250/150, and the win rates carry intervals of roughly 23% to 36% and 14% to 25%. Those intervals measure Monte Carlo sampling noise within this model at 200 paths; they say nothing about whether the model resembles real markets.
| Book | Median after-tax wealth | Paired median vs. 100/0 (95% CI) | Paths beating 100/0 (95% CI) | Gross losses realized | Tax benefit used | Liquidation tax |
|---|---|---|---|---|---|---|
| 100/0 | $1.62M | baseline | baseline | $765k | $111k | $180k |
| 130/30 | $1.50M | -$118k (-$142k to -$81k) | 29% (23% to 36%) | $2.43M | $157k | $119k |
| 150/50 | $1.40M | -$165k (-$223k to -$126k) | 26% (20% to 33%) | $3.15M | $185k | $127k |
| 200/100 | $1.26M | -$324k (-$387k to -$251k) | 26% (20% to 33%) | $4.70M | $235k | $165k |
| 250/150* | $1.13M | -$427k (-$497k to -$353k) | 19% (14% to 25%) | $5.54M | $263k | $170k |
Medians across 200 common-random-number paths (seed 7), $1M start, 10 years, zero alpha, full liquidation, talsim v0.4.0. Intervals are bootstrap (paired median) and Wilson (win rate) sampling intervals within the model; they do not measure model error. *250/150 is the target book; the FINRA-floor margin model runs it as roughly 233/133.
Meanwhile the loss engine works as advertised, and cleanly: with the trading policy substituting names instead of repurchasing what it just harvested, the wash-sale ledger disallowed nothing at all on these paths. Gross deductible losses grow from $0.77M at long-only to $5.54M at 250/150. But the tax benefit used reaches only about $263,000, 2.4 times the long-only figure, from 7.2 times the loss generation. The bottleneck is arithmetic: losses first net against the portfolio's own realized gains, and what remains can only offset the $100,000 of outside gains that exist each year plus $3,000 of ordinary income. Everything else becomes carryforward or waits for liquidation. In this baseline configuration, gains to offset are the scarce resource, and loss realization outruns them at every leverage level.
The costs that pay for that loss engine compound with gross exposure. At 250/150 the median path pays roughly $112,000 of stock borrow, $194,000 of payments in lieu of dividends, $67,000 of transaction costs, and $80,000 of dividend taxes over the decade, against $49,000 of management fees. Under Publication 550, payments in lieu on shorts held under 46 days are not deductible as investment interest; the model capitalizes them into cover basis only for shorts closed within that window, and gives longer-held payments no tax benefit at all, a deliberate conservatism.7 Even the long-only book shows a cost line worth noticing: staying fully invested while paying fees and taxes from cash produces about $36,000 of margin debit interest, the price of running at 100% without a cash buffer. A small cash reserve or a sell-to-fund policy would remove most of that charge; it is a funding choice of this baseline.
Risk scales alongside. Median tracking error rises from 2.0% to 19.6%, median max drawdown from 33% to 56%, and annual turnover from 0.5x to 5.9x. The margin model is explicit: a 250/150 book fails a FINRA-floor maintenance test before its first trade (the requirement is 107.5% of starting equity), so the engine keeps its 100% net core and shrinks the long/short extension to the largest feasible size, roughly a 233/133 book, and any later deficiency forces real deleveraging with transaction costs and tax consequences.9 Real brokers set house requirements above the percentage floors (and the rule adds per-share minimums for cheap stocks), which would bind sooner.
The liquidation-tax column shows deferral working as designed, and then coming due: the long-only book pays the largest median terminal tax bill, about $180,000, against $119,000 to $170,000 for the levered books. The gap is widest at 130/30 and 150/50 and narrows at the highest leverage, where a much larger gross book carries more unrealized gain into the unwind. The low-turnover book carries a decade of unrealized gains into the final year; the high-turnover books already realized and paid tax on most of their gains along the way. Deferral is a real benefit, but it is a loan from the tax authority, and full liquidation is the day the loan is called.
The conclusion moves with the fact pattern
A single scenario proves little, which is why the simulator reruns the whole ladder under five predefined fact patterns on common paths. They are the five we chose to test, and they do not cover the parameter space:
- No outside gains. The usable tax benefit collapses to roughly $8,000 to $11,000 of tax saved over the whole decade, regardless of how many millions in losses the book realizes. That is close to the ceiling the ordinary-income deduction allows: $3,000 a year at 40.8% is worth at most about $1,224. If you do not have gains, a loss factory manufactures inventory for a customer who never arrives.
- A one-time $500,000 gain in year 3. Benefit used rises steeply with leverage (about $205,000 at 250/150, four times the long-only figure), because a big gain arriving mid-path is exactly what a loss engine is for. Median wealth still declines at every leverage step: the benefit never outruns the costs and risk that produced it.
- An alpha scenario, calibrated to +75 bps at 150/50 and scaled with configured active gross exposure, so 130/30 gets about 45 bps, 200/100 about 150 bps, and 250/150 about 225 bps, delivered through the return-predicting signal. That is a leverage-friendly assumption, and it narrows the penalty without reversing it: the best levered book (150/50) beats long-only on 36% of paths, with a 95% interval of roughly 27% to 46%. The result that would pay for leverage is alpha, which is precisely why a simulator must report alpha and tax effects separately instead of blending them into one “after-tax return.”
- Higher costs (95 bps fee, 175 bps borrow, 15 bps trading). The 250/150 median ends at $847,000 and 200/100 at $993,000, both below the money they started with. Elm Wealth's independent simulation reached a similar destination by another road: in their zero-alpha base case, fees consumed most of the modeled tax advantage.6
The spread across these panels is the finding. Khang, Paradise, and Dickson measured about 300 bps of dispersion in loss-harvesting tax alpha across investor circumstances, with roughly 60% of the variation driven by investor characteristics rather than markets.2 The productive question for any TALS pitch is therefore conditional: given your gain schedule and its character, your tax rates, your costs, your exit plan, and your honest belief about alpha, what does the distribution of fully liquidated after-tax outcomes look like?
Estimate it for your numbers
The charts above are one fact pattern. The calculator below reads a precomputed grid of 900 talsim cells (five books across five outside-gain levels, three cost tiers, two alpha assumptions, three horizons, and two federal brackets, 100 common-random-number paths each) and rescales the dollar figures to your starting capital. It answers the same question as the article, conditioned on your gain supply, costs, and exit horizon: what does the distribution of fully liquidated after-tax outcomes look like, and how often does the levered book end ahead of long-only on the same market path?
Three things stand out as you move the controls. The usable benefit rises with outside gains and then flattens once the book already harvests more than you can absorb, while costs keep rising with leverage regardless. The cost tier moves the wealth line more than the alpha toggle does: at 150/50 on the grid's $1M, 10-year, top-bracket, 10%-gains cell, going from the low to the high cost tier costs about $160,000 of median wealth, while adding 75 bps of alpha recovers about $50,000. And across all 720 levered book-cells in the grid, only two end ahead of long-only at the median, both with alpha on, low costs, and the 24% bracket.
What the simulator deliberately leaves out
talsim is a research model, and its omissions are part of the result. The tax accounting is a simplified federal approximation: one wash-sale group per ticker, when the real rule reaches spousal accounts, controlled corporations, and IRAs, where a washed loss is not deferred but permanently destroyed.78 Short-sale character rules are collapsed to short-term. Tax savings accrue to a zero-return side account instead of compounding, which understates the value of benefits that arrive early or in size. The universe is 36 stocks harvested quarterly; production books hold hundreds of names and trade far more often, which changes substitution quality, harvest capacity, and wash-sale exposure in ways this run does not test. The year-10 full liquidation is one exit assumption among several; Goldberg, Cai, and Schneider report that liquidation alone cuts modeled tax alpha roughly in half, so an estate or perpetual-hold plan would change the picture.5 The market is Gaussian by step, with no jumps, volatility clustering, delistings, borrow recalls, or capacity limits; the trading policy is a transparent heuristic rather than a risk-model-constrained optimizer. Tax-aware optimization at production quality is hard; Moehle, Kochenderfer, Boyd, and Ang is the reference treatment of the convex-optimization approach.10 What a transparent toy buys you is the ability to see every moving part, which a black box, by construction, does not.
Questions to ask anyone selling you harvested losses
- What does this strategy return at zero alpha, after all costs?
- Show me distributions, percentiles, and paired comparisons against a passive baseline, not the average or the best backtest.
- How many of my actual gains, short- and long-term, will these losses offset in each of the next five years, after netting against the strategy's own realized gains?
- What happens at liquidation, and what is the plan for exit?
- What are the all-in financing, borrow, and payment-in-lieu costs at my leverage level?
- How close does the book run to maintenance margin in a drawdown, and what happens when it gets there?
- Which results in the pitch come from tax mechanics, and which come from assumed alpha?
Key takeaways
- Gross losses are activity; benefit used is money. In our zero-alpha simulation, 7.2x the harvested losses bought 2.4x the realized tax benefit, and the 250/150 book ended a median $427,000 behind long-only on identical market paths ($1M, 10 years, full liquidation).
- Gains to offset are the binding constraint. Levered books first absorb losses with their own realized gains; with no outside gains at all, the decade's usable benefit fell to roughly $8,000 to $11,000.
- No leverage level beat long-only at the median in any of the five scenarios, including the alpha scenario (75 bps at 150/50, scaled to 45 to 225 bps across books), where the best book won on 36% of paths.
- Costs compound with gross exposure. Borrow, payments in lieu, trading, and dividend taxes reached roughly $453,000 over ten years on the median 250/150 path at baseline cost settings.
- Deferral is a loan that liquidation calls. The long-only book's median terminal tax bill ($180,000, against $119,000 to $170,000 for the levered books) was the largest, because it deferred the most along the way.
- Leverage runs into margin math. 250/150 fails a FINRA-floor maintenance test before its first trade; the model keeps its net exposure and shrinks the extension, running it as roughly a 233/133 book. Real house requirements are stricter.
- Reproducibility is the product. Every chart regenerates from a config and a seed; path-level results, manifests with checksums, and regression tests for past defects ship with the repo.
How Summitward helps
Tax-Loss Harvesting Calculator
Value the loss lots you already hold at your own federal and state rates, net them against your realized gains, and see what a harvested dollar is actually worth before anyone sells you a loss engine.
Open the TLH CalculatorFrequently asked questions
Does this simulation prove TALS strategies lose money?
No. It shows that in one controlled synthetic setting, with zero alpha and full liquidation, leverage reduced median after-tax wealth while multiplying harvested losses. Real strategies argue for positive expected alpha from factor exposure, real investors differ in gain schedules and exit plans, and published research finds meaningful benefits for investors with steady short-term gains. The simulation demonstrates which assumptions the conclusion depends on, so you can ask about yours.
Why simulate at zero alpha when managers expect alpha?
Because the two claims are sold as one product. A tax benefit is verifiable mechanics; alpha is a forecast. Pricing them separately tells you what you are paying for each. If a strategy only works with its alpha assumption switched on, it is an active-management decision, and it should compete with every other use of your risk budget on those terms.
How does the model handle wash sales?
Two independent layers. The accounting ledger enforces the rule itself: any loss with a replacement purchase inside the window, in either direction, is disallowed, added to the replacement shares' basis, and its holding period tacks, whatever the trading policy does. Separately, the policy avoids washes the way real managers do: it will not harvest a freshly bought name, it waits out the window before re-entering, and it redistributes blocked exposure to substitute names, and partial matches split replacement lots share-for-share with basis transfer and holding-period tacking. The window is an exact elapsed-day comparison, so a repurchase one quarter (91 days) after a loss sale is correctly legal. On the shipped experiment paths the compliant policy left the ledger nothing to disallow; the enforcement exists for noncompliant trade lists and finer cadences, and disallowed amounts are always reported as their own line.
What would make the leverage worthwhile in this model?
Some combination of: large recurring short-term gains that outrun the strategy's own realized gains, genuinely positive alpha beyond the 45 to 225 bps tested here, lower financing and borrow costs, a long deferral runway instead of a hard liquidation, or a step-up-oriented estate plan that the model deliberately does not include.
Can I run my own numbers?
Yes, two ways. The calculator above covers the inputs that change the answer without installing anything. For arbitrary gain schedules, cost assumptions, or exposure presets, install the package with pip install pytalsim(it imports as talsim). The package runs 56 tests including regression and property-based tests for previously found accounting defects, and regenerates every figure here from two commands. Change the gain schedule, rates, costs, alpha, or exposure presets in one config object and rerun; a manifest records every assumption, the git commit, and output checksums beside the results.
Related guides
- Tax-Aware Long-Short: Real Tax Alpha or Complex Marketing?: the primer on what TALS is and who it fits.
- Tax Alpha: what the term means and how it gets inflated.
- Do You Need Direct Indexing?: the long-only version of the harvesting question.
- Tax-Aware Decumulation: the exit-path planning this article's liquidation tax makes concrete.
Sources
- talsim v0.4, open-source TALS research simulator (MIT license, on PyPI as pytalsim): configs, seeds, manifests, path-level results, changelog, and the code behind every figure. github.com/engineerinvestor/talsim
- Kevin Khang, Thomas Paradise, and Joel Dickson, “Tax-Loss Harvesting: An Individual Investor's Perspective,” Financial Analysts Journal 77(4), 2021 (~300 bps dispersion across investors; ~60% driven by investor characteristics). tandfonline.com
- AQR, “Our Research into Tax-Aware Long-Short Investing: Clarifying a Few Important Things,” January 2025 (TALS is distinct from direct indexing; leverage and tracking error need alpha compensation; gain deferral is central). See also Liberman, Krasner, Sosner, and Freitas, “Beyond Direct Indexing: Dynamic Direct Long-Short Investing,” Journal of Beta Investment Strategies, 2023. aqr.com
- Stanley Krasner and Nathan Sosner, “Loss Harvesting or Gain Deferral? A Surprising Source of Tax Benefits of Tax-Aware Long-Short Strategies,” Journal of Wealth Management, 2024. aqr.com
- Lisa Goldberg, Taotao Cai, and Ben Schneider, “A Guide to 130/30 Loss Harvesting,” Journal of Asset Management 25, 2024 (open access): 2.7x the capital losses of long-only over the first decade; 4.41%/yr pre-liquidation tax alpha in the sufficient-gains case; liquidation cuts it roughly in half. springer.com
- Victor Haghani and James White, “Robbing Peter to Pay Paul: A(nother) Look at Long/Short Direct Index Tax-Loss Harvesting,” Elm Wealth, April 13, 2026. elmwealth.com
- IRS Publication 550, Investment Income and Expenses: wash sales (30 days before or after, spouse, controlled corporation, IRA), the $3,000 capital-loss limit, short-sale rules, and payments in lieu of dividends. irs.gov
- IRS Revenue Ruling 2008-5: a loss on stock repurchased in an IRA within the wash-sale window is disallowed and the IRA's basis is not increased. irs.gov (PDF)
- FINRA Rule 4210, Margin Requirements: 25% maintenance on long margin securities; the greater of $5 per share or 30% of market value on shorts at $5 and above. finra.org
- Nicholas Moehle, Mykel Kochenderfer, Stephen Boyd, and Andrew Ang, “Tax-Aware Portfolio Construction via Convex Optimization,” Journal of Optimization Theory and Applications 189, 2021. stanford.edu (PDF)
Author disclosure
Educational content, not tax, legal, or investment advice. The simulation is synthetic and its tax accounting is a documented research approximation, not tax-return-grade accounting; consult the repository's README for the full list of simplifications before citing any figure. Summitward built and maintains talsim, published under its Engineer Investor open-source account. Summitward has no position in, or business relationship with, any TALS manager named here.
More in Tax Strategy
Browse all tax strategy guidesGet new guides by email
Evidence-based, no jargon. At most two emails a month. Unsubscribe any time.
Try it in Summitward
See tax-loss harvesting calculator in action with your own financial data. Free to start, no credit card required.