# What is an appropriate algorithm to use for tax loss harvesting?

I've been reading into how Betterment and Wealthfront have architected their tax loss harvesting algorithms, but they stop short of providing any real examples.

Essentially, they both reduce to:

Benefit – Cost ≥ Threshold


They differ in how they define each term, however. Threshold is proprietary and the result of Monte Carlo research, so let's leave it aside for now.

Benefit looks like it is best measured as a percentage of the asset class in the portfolio. For example, if cost basis of the emerging markets fund makes up 10,000 of a portfolio and the loss is $400, does it make sense to say the benefit is ($60 ÷ \$10,000) = .6%


Then cost, for example, would equal the management fee difference. Let's say .09% and .18%, plus any commissions or bid/ask spread losses expressed as a percent.

(.09% - .18%) - 0 - 0 = .09%


Making the difference

.6% - .09% ≥ Threshold