I have been reading that there are various tax laws that prevent one from doing things like locking in one's short term gains on a stock by purchasing (or selling) options, or resetting one's cost basis by selling and repurchasing a stock. Does this also apply if one of the accounts is tax sheltered and the other is not?

For instance, suppose I purchase a stock in an IRA and it appreciates in value. I then sell the stock but immediately repurchase it at about the same price in a non-tax sheltered accounts. Does this effectively reset my cost basis so I don't have any tax on the original gain since all the gains were in the IRA? What if it was a wash sale where I sold in my regular account and re-bought in the IRA?

Likewise, suppose I buy a stock and it skyrockets, but I'm concerned about it crashing before I can hold it for a year. If I sell immediately I could incur substantial taxes because it would count as ordinary income. If I sell options against it to lock in the gain it also counts as ordinary income even if the options are long term.. But what if I hedged the stock by selling options in an IRA account and the stock crashes. Does this bypass the taxes because the gains were in a tax sheltered account?

Even if I used two non-sheltered accounts this would apply, but does it make any difference if one of the accounts is tax sheltered?

Assume that in both cases the IRA is a Roth IRA, so I effectively pay no taxes on the gains, even when withdrawing.

3 Answers 3


What if it was a wash sale where I sold in my regular account and re-bought in the IRA?

You can't harvest loss. From https://www.investopedia.com/articles/retirement/09/ira-wash-sale-rule.asp (mirror):

In 2008, the IRS issued "Revenue Ruling 2008-5," in which it addressed the question of whether the wash-sale rules apply to IRAs. In the ruling, the IRS explained that when shares are sold in a non-retirement account and substantially identical shares are purchased in an IRA within 30 days, the investor cannot claim tax losses for the sale, and the basis in the individual's IRA is not increased.


You can't sell options to lock in gains and protect the principal. In practical terms, you can hedge some of the risk with option selling but not all of the principal.

There is no prohibition against protecting gains with short options or locking in gains with long options.

The only limitation is what types of trading are allowed in your retirement account (for example, you can't sell naked options).

There may be tax consequences for various types of trading. For example, selling non qualified covered calls changes the holding period of the stock.

If you want to reset cost basis by moving a position from sheltered to non sheltered or vice versa, the IRS has no issue with gains. However, you will owe taxes on those gains either now (non sheltered) or later when you begin making withdrawals (sheltered).

Where you can get into trouble is wash sales (see Frank's answer).

The short answer is that you cannot avoid taxes on capital gains. You pay them now or you pay them later.

  • 1
    Some of what you are saying is confusing me... you said I will owe taxes on the gain when I begin making withdrawals (sheltered) but isn't a Roth IRA not taxed on withdrawals of gains? And you say you can't sell options to lock in gains, then say there is no prohibition on it, then say there may be tax consequences. The tax consequences are exactly what I'm looking for references to - for instance, I can't sell a covered call from a sheltered account on a stock in a non-sheltered because my broker would treat it as naked... (cont)
    – user12515
    Feb 4, 2021 at 16:49
  • ...but if I bought a put it's not clear to me if the sheltered nature of the account would prevent it from "co-mingling" for tax purposes, or if the fact that it's a separate account of different tax status would prevent this, just like it would prevent me from writing the calls.
    – user12515
    Feb 4, 2021 at 16:50
  • Tie my first 3 paragraphs together. Then see paragraph #3: `The only limitation is what types of trading are allowed in your retirement account (for example, you can't sell naked options). That's why you can't sell a naked call in your retirement account, for any reason. Feb 4, 2021 at 17:01
  • 1
    In the early part your question you stated IRA not Roth IRA so take my answer as applicable to a traditional IRA. If you are placing trades in two separate accounts then those trades are separate as is the taxation. No comingling. Suppose you own stock in a traditional IRA and you buy protective puts in your regular account. Gains on the IRA will be paid when you make withdrawals. Gains and loss in your regular account will go on the tax return of the year the trade is closed. Feb 4, 2021 at 17:02

It is legal and I have done it to sell a stock for a profit and the same day buy the stock back. This will reset the cost basis. It will also generate a tax liability. The wash rule does not apply in this case because you sold it stock at a gain.

You must log in to answer this question.