ToolsYear-End Loss Harvest Maximizer

Year-End Loss Harvest Maximizer

Late-year harvesting. Maximizes realized losses through year-end while capping gains to zero.

Window
Nov – Dec snapshot
Output
Lot-level sell list
Gain ceiling
$0 (no offsetting gains taken)
Headline resultIllustrative
$71,400

Net loss available against external gains

The idea

Looks at what's down in the portfolio and tells you the most loss you can bank by Dec 31 without a wash-sale violation.

The objective
Maximize Σ realized_loss_i for i in lots, subject to: Σ realized_gain_i = 0, no buys in the 30-day pre/post window of any sold-loss ticker (US wash-sale rule), and a tracking-error drift cap after harvest.

The tool solves this on demand against a portfolio snapshot — typically in a single CVXPY call, or a short loop for multi-period tools. Unlike a strategy, there is no daily-rebalance schedule; you re-run when the inputs change.

What goes in, what comes out
Inputs
  • Portfolio snapshot dated in November or December
  • Recent trade history (for wash-sale lookback)
  • Optional: tracking-error drift cap
Outputs
  • Lot-level sell list with realised loss per lot
  • Locked-ticker list with lock-expiry date
  • Net realised loss available against external gains
Worked example

$2M tax-aware DI account; snapshot December 5; 18 lots show embedded losses; 6 lots are wash-sale locked from a November trade.

Eligible loss-bearing lots
12 of 18
Total realisable loss
$71,400
TE drift after harvest
+ 14 bp
Locked names, expires Jan 4
12
Net loss available against external gains
$71,400

Six lots are unreachable because of the November lock, but the remaining twelve produce a clean $71k of harvestable loss with only 14 bp of TE drift. Numbers are illustrative.

Input

Tracking-error drift cap

Default · 25 bps

The maximum additional tracking error the post-harvest portfolio is allowed to take on. Sets how aggressively the optimizer can rotate out of loss-bearing names before the substitutes start to drift.

How the optimizer applies it

After the harvest sells, the optimizer buys correlated substitutes inside the residual budget. The drift cap binds when loss-bearing names cluster in a single sector or factor and the substitutes don't perfectly replace them.

The trade-off

A tight cap (5 bps) preserves the portfolio's index hug but leaves harvestable losses on the table when substitutes are imperfect. A loose cap (100 bps) banks more loss now at the cost of a noisier portfolio for the next 30 days.

Other tools

Educational calculator. Output is illustrative and is not investment or tax advice.