liveBook · Manning

Evaluate_harvest

As explained in Build a Robo-Advisor with Python (From Scratch)

evaluate_harvest is a book-specific function that evaluates whether harvesting a single tax lot with a specified replacement investment has positive net benefits.

evaluate_harvest evaluates whether harvesting one loss-making tax lot with a specified replacement ETF produces positive net benefits. It weighs transaction costs against opportunity costs before deciding whether to harvest. section 14.3.3

The evaluation receives:

  • A harvest decision used by higher-level routines that select suitable replacements and assemble trades across ETF sets. section 14.3.3

Choosing ITOT as a replacement

With VTI lots purchased for $90–$94 and priced at $80, the surrounding evaluation produces trades that sell selected VTI, SCHB, and SPTM lots for $800 and replace them with ITOT.

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Combines transaction-cost and opportunity-cost calculations before making the harvest decision.
Examples
Uses VTI, ITOT, SCHB, and SPTM lots priced below purchase prices to generate replacement trades.
What it assumes
Assumes an eligible loss-making lot and supplied market, tax, volatility, dividend, and spread data.
What you can do after
Apply via Python to decide whether an eligible loss-making tax lot should be harvested.
How it connects
Connects tax-loss harvesting with wash sales, exchange-traded funds, transaction costs, and opportunity cost.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.