Virtually all companies and individuals are faced with the management of taxable assets. To manage these assets efficiently, investors need to be aware of the impact of taxes on investment returns. In the study we report in this article, we quantified the benefits of loss harvesting and highest in, first out (HIFO) accounting by using Monte Carlo simulations and investigated the robustness of these strategies in various markets and with various cash flows and tax rates. We concluded that a market with high stock-specific risk, low average return, and high dividend yield provides more opportunities to harvest losses. In addition, a steady stream of contributions refreshes a portfolio and allows the benefits of loss harvesting to remain strong over time. Conversely, withdrawals reduce the advantages of realizing losses. Our findings show that no matter what market environment occurs in the future, managing a portfolio in a tax-efficient manner gives substantially better after-tax performance than a simple index fund, both before and after liquidation of the portfolio.