*Edit: Assume that C and D have both been held longer than 30 days, so there are no wash sale complications.*) Suppose I intend to keep a position in this ETF long-term.

**In what order should I sell these tax lots to maximize long-term after-tax portfolio value?**

I hope there's enough information here to answer the question. I have an answer and I'd like to know if the reasoning is sound. My answer: sell in this order: C, D, B, A. My reasoning: Sell losses first to avoid paying taxes on the gains for A and B today; these losses can be used for tax loss harvesting. (So that means C and D should be sold before B and A.) Sell C before D because that will result in the lowest taxable gains when you sell at the future (presumably higher) price. Then sell B before A to minimize taxable gains today. So the final order is C, D, B, A.