In years when the stock market trends downward, investors often look to make the best of a bad situation by using those losses to gain tax advantages. Some incorrectly believe that losses in their stock portfolio can offset taxes on their wages. Consequently, tax-loss harvesting (TLH) is used, which might create real losses. TLH is implemented by selling assets that have underperformed in order to create a tax loss, while simultaneously buying comparable assets to maintain a substantially similar investment position.

TLH can be beneficial in specific situations but detrimental in others. You have to understand not just the investment risk associated with such transactions but also the tax implications. It’s the kind of strategy best left to a professional to execute. Keep these five tips in mind when considering if this tax strategy is something to discuss with your investment advisor.

1: Tax Deferral Only
While some strategies, like a home office deduction or health savings account contribution, create permanent tax savings, TLH is a strategy that only defers taxation of capital gains. The amount of tax savings you might enjoy this year will eventually become taxable when you liquidate the replacement investments. This strategy might be highly beneficial in a portfolio that you will bequeath to your children, since the deferrals will become permanent when they are inherited.

2: Loss Deduction Limit
It’s likely that the average person does not have a large amount of investment income, so TLH is rarely beneficial. If most of your income is business income or ordinary wages, you can only deduct an excess of $3,000 per year of capital losses. The silver lining is that non-deductible losses are rolled forward indefinitely, until they are chipped away each year $3,000 at a time, or you have capital gains to offset.

3: Future Tax Bracket
If you expect to make more money in the future, deferring taxable income can actually be detrimental if you later find yourself in a higher tax bracket. The only way to create permanent tax benefits from TLH is to harvest in a year you are in a high tax bracket and revert the position in a year you are in a low tax bracket. Because of the uncertainty about future tax brackets, for you personally or taxes in general, it can be hard to sustain a permanent gain from this strategy.

4: Wash-Sale Rules
Wash-sale rules can negate tax-loss harvesting if you plan to sell and buy the same security within a 60-day window. Active traders should particularly pay attention to wash sales if they buy and sell the same security over and over. Remember, cryptocurrencies are considered property by the IRS and thus not subject to wash-sale rules. A key aspect of TLH is that you sell one security and buy a similar one—not the same one—in order to avoid wash-sale rules.

5: Investment Account Type
TLH does not apply in a tax-deferred account like a 401(k) or IRA. These accounts do not get taxed on gains and thus any gains or losses do not impact your taxes. Therefore, it’s unnecessary to implement this strategy in a tax-deferred account since all gains and losses are deferred anyway.

In short, while tax-loss harvesting can be a great strategy for investors, it’s very limited in scope. It’s not a strategy that you should implement on your own, but rather one that your financial planner and tax advisor should put together for you when it’s beneficial. Keep this tax strategy in the back of your mind for those years when your tax bill might be abnormally high from large amounts of capital gains.