As mentioned here, Tax Loss Harvesting (TLH) involves selling tax lots that have declined in value. In a Direct Indexing based TLH method, when a tax lot is sold for a loss, we do not strictly replace a security with another. Instead we construct a factor model of the portfolio, and when selling a security, we try and bring the overall portfolio back in line to it's target factor model weights.
At Double we use a 4 factor model consisting of value, quality, momentum and min_volatility. This is re-calculated regularly based on the covariance between price changes and a daily price change representing those factors.
A quick example
Lets say you own 5 securities, and 1 one them, called AAA goes down in value 10%. Our optimizer will identify this Loss Harvest opportunity, and determine if it's worth harvesting. If it is, we will sell it. We will then deploy the cash generated from this TLH opportunity back into the portfolio.
To determine how to deploy this cash back into the portfolio, we will look at the overall portfolio's targets and their factors. Lets say the portfolio's factor averages including the stock you just sold were 0.5 for value, 0.75 for quality, 0.9 for momentum and 0.5 for min_volatility. We would then take the cash generated from our TLH sale and look at the remaining 4 stocks factors, and we would buy quantities of the remaining 4 to try and get our target factor exposure back to the overall targets. So if we sold something that was a value stock, we would generally try and replace it with something with a similar value factor.
We require a portfolio to be diverse in order to have sufficient factor exposure and do Direct Index TLH.