A turbulent year in the market may have generated some losses in your taxable investment accounts. You can put those losses to good use with a strategy designed to maximize after-tax returns known as tax-loss harvesting. To be a harvester, you sell an investment to generate a loss to offset capital gains. "We harvest losses annually, and this year will be no different," said Scott Stratton, a certified financial planner, certified public accountant and president of Good Life Wealth Management. "People in the top tax bracket should definitely try to offset any short-term gains for 2016."

Anne Rippy | Getty Images

Why? President-elect Donald Trump has proposed lowering the top federal tax bracket from 39.6 percent to 33 percent and eliminating the 3.8 Medicare surtax on investment income. "For taxpayers in the top tax bracket, they would be paying 43.4 percent on investment income and short-term capital gains this year," Stratton said. "Next year those losses would only be worth 33 percent" if Congress approves Trump's tax plan. In other words, tax losses may be worth more now than next year. Even if Trump's proposed push for lower income-tax rates isn't approved, you can still benefit from knowing the ins and outs of tax-loss harvesting.

Short- and long-term capital gains

How long you hold an investment determines your capital gains tax rate. Short-term capital gains and losses are from investments that you have owned for one year or less, while long-term capital gains and losses are from investments held longer than one year.

Short-term capital gains are taxed as ordinary income. So if you are in the 25 percent federal tax bracket, your short-term capital gains rate is 25 percent. Long-term capital gains have lower tax rates than short-term gains. Single filers who earn $50,400 or less and married couples earning up to $75,300 this year pay no long-term capital gains taxes. The rate is 15 percent for people who earn less than $415,051 as a single filer and $466,951 for married couples filing jointly in 2016. The long-term capital gains tax rate is 20 percent for income above those limits. Under Trump's proposed tax plan, more people would pay the 20 percent long-term capital gains rate. The rate would affect single filers with a taxable income above $112,500 and married couples with income above $225,000. However, most people would pay less income tax overall.

In a neutral year, tax-loss harvesting is a good idea. When you expect tax rates to drop next year, it's a great idea. Bill Smith managing director of accounting firm CBIZ MHM's national tax office

To complicate matters, people with modified adjusted gross income of $200,000 for single filers and $250,000 for married couples are subject to the 3.8 percent net investment income tax on both short- and long-term capital gains. (Trump and House Republicans have proposed eliminating this tax.) If your capital gains are lower than your losses, you can claim up to $3,000 of the loss on your tax return. Remaining losses can be carried forward to use against future capital gains.

"In a neutral year, tax-loss harvesting is a good idea," said Bill Smith, managing director of accounting firm CBIZ MHM's national tax office in Washington. "When you expect tax rates to drop next year, it's a great idea."

Wash-sale rule

The wash-sale rule can rain on your tax-loss harvesting plans. The Internal Revenue Service prohibits you from claiming a loss on the sale of a security if you buy a "substantially identical" security within 30 days before or after the sale. "People worry about the wash-sale rule and sit in cash for 31 days," Stratton said. "Don't miss the market moves. Instead, swap your sold position for a different fund." If you ignore the wash-sale rule, you can lose your deduction for the tax loss. "Many people do not realize that the wash-sale rule applies across different types of accounts," said Jeffrey Birnbaum, a CFP and an enrolled agent with On Point Financial. For example, you can't sell a losing stock in your taxable account and buy it back in your individual retirement account. "The wash-sale rules still applies," Birnbaum said. More from Portfolio Perspective:

No Trump bump yet for luxury goods stocks

4 winning investment moves for the Trump tax era

How President-elect Trump's plans will impact your year-end money moves



Prioritize your portfolio

Don't let the tax tail wag the investing dog. "When it comes to taking tax losses, the guideline should not be to maximize the amount of the loss generated," Birnbaum said. "The guideline is to be strategic, optimize the net benefit, taking into consideration the income-tax implications as well as other factors, such as the impact on the investment portfolio."

Many robo-advisors offer automatic tax-loss harvesting, including Betterment, Charles Schwab and Wealthfront. Betterment estimates its tax-loss harvesting service can add 0.77 percent to an average customer's after-tax returns annually. Other investment advisors aren't so optimistic about tax-loss harvesting. "Once transaction costs and the fact that 'comparable but not identical' investments do perform differently are factored in, it rarely seems to be beneficial," said David Mendels, a CFP and director of planning at Creative Financial Concepts.