Although volatile markets can give investors many headaches, they also give investors several opportunities to lower their tax bills if they play their cards right. Investor sentiment about international markets (particularly China’s) and domestic economic growth has led to the volatility in the major indices that we have seen in the past few months. This in turn has given smart investors a chance to take advantage of lower prices and asset value. Here’s what you can do to profit from a volatile market on your tax return.

Roth Conversion

If your traditional retirement plans and accounts have taken a real beating in the markets over the past few months, then this might be a good time to convert them to Roth IRAs. The lower prices in these accounts mean lower taxable balances that must be reported and thus a lower tax bill. The markets are now at their lowest levels since September 2015, so this may be a good time to pull the trigger on a Roth conversion. But you may come out ahead by waiting if the markets continue to drop from here.

If you already converted your plan balances to Roth accounts in the past few months, then you may be able to re-characterize (undo) your conversion and do it again now when prices are lower. This strategy can be especially effective if you are currently unemployed or your taxable income is lower than usual for any other reason, as it may allow the entire conversion balance to be taxed at a lower tax rate. (For more, see: When is a Roth IRA Conversion the Right Move?)

Buy Low

If your portfolio is heavily weighted towards fixed-income securities or other conservative holdings, then this may be a good time to start buying into the markets as the turbulence persists. A dollar-cost averaging strategy is a great way to take advantage of market volatility and lower your investment costs. The simplest way to do this is to find a good stock mutual fund with a solid long-term track record and start buying a set dollar amount of shares each month. This way, you will buy more shares when prices are lower and fewer shares when prices rise.

Tax-Loss Harvesting

If you have investments in taxable retail accounts that have lost value in recent months, then you may be able to lower your tax bill by selling off your depressed holdings and then buying them back again. This way, you can generate investment losses that will lower your overall tax bill. Just be careful to obey the IRS Wash Sale Rule, which mandates that you have to wait for at least 31 days before you can buy back a materially identical security after selling it if you intend to declare the loss. This does mean that if the price of your security rises during the waiting period that you will have to buy it back at the higher price at the end of the waiting period. In some cases, you may be wise to simply purchase an exchange-traded fund (ETF) that holds a basket of securities that are similar to the one that you dumped. (For more, see: How to Avoid Violating Wash Sale Rules When Realizing Tax Losses.)

For example, if you were holding a biotech stock in your taxable account and it dropped sharply in price, then you could sell it and immediately replace it with an ETF that invests in a biotech index. This index might even hold the stock that you sold, so that you will still have an interest in it, but it will not be considered a materially identical security by the IRS for the purpose of the Wash Sale Rule. You can also credit all of the losses that you generate against any taxable gains that you have realized during the year, and then write off $3,000 of any excess losses against your other income each year until you have written off the entire loss amount.

Gifting Strategies

If you are looking to reduce your taxable estate and gift cash or assets to children or other beneficiaries, then volatile markets can provide you with a way to transfer assets at depressed prices and thus reduce your estate by a larger amount. Lower prices mean that you can gift more shares of stock to your recipient without exceeding the annual dollar limitation, and then when prices rebound, your beneficiary will profit accordingly and so will you with a smaller remaining estate. (For more, see: Estate Planning Tips for Financial Advisors.)

The Bottom Line

Volatile markets can spell opportunity for investors who understand the tax rules and know how to use their assets to make those rules work for them. Roth conversions, dollar-cost averaging, tax-loss harvesting and gifting programs can all be used to reduce your income and estate tax bills and thus keep more money in your pocket. (See also: Pros and Cons of Annual Tax Loss Harvesting.)

Want to learn how to invest?

Get a free 10 week email series that will teach you how to start investing.

Delivered twice a week, straight to your inbox.