This year has been a roller coaster for investors, with good months followed by steep pullbacks. At this point, you may have taken some gains and losses in your taxable accounts during 2018; you also may have unrealized losses as well as gains.

The classic strategy is to tabulate all of your capital gain and loss transactions for the year to date to see the net result so far. If you own mutual funds in taxable accounts, check the fund companies’ websites for projections of year-end capital gains distributions, which will count as taxable gains.

Net losses

If you have taken more losses than gains, you might want to take gains by year-end. Such gains won’t increase your income tax, as long as they don’t move you into positive gains for the year.

After you take gains by selling securities, you can buy them back right away if you want to maintain your investment. This will raise your basis in the reacquired shares, leading to better tax results on a subsequent sale.

If you don’t want to offset net losses with gains, you can deduct up to $3,000 of net capital losses on your 2018 tax return. Excess losses can be carried over to future years.

Net gains

If you end the year with net capital gains, you’ll owe tax; the tax rate might be steep if short-term capital gains (sales after a holding period of one year or less) are included. In this scenario, you might want to take capital losses by December 31 to bring down or eliminate this year’s net gains.

A capital loss won’t count for this year if you buy back the relinquished assets within 30 days of the sale in what is known as a wash sale. However, you can buy a similar asset if you wish. For instance, you can sell an emerging markets stock fund at a loss and put the proceeds into an emerging markets fund from another company immediately, if you think such stocks will rebound.

Assuming you have held the devalued assets for more than 30 days, another strategy is to simply wait on the sidelines for at least 31 days after selling the assets for a loss, then buy back the stock or fund you’ve sold. You won’t have a wash sale, so the capital loss will be effective.

One other plan is possible if you act before the end of November. You can “double up” by buying an equal amount of the securities you intend to sell at a loss. Then, wait 31 days to sell the original position by year-end for a capital loss in 2018. If the shares have bounced back by then, you probably won’t regret buying more of them!