I got into investing last year and there is a repeated trade on a stock I made that is bothering me. I'm not sure I fully understand the wash sales rule. Most of the examples online discuss selling a stock for a loss and re-buying the same stock and then selling it for a profit, which means you have a gain, but can't use the losses. I've since moved into an actual brokerage account and learned about panic trading vs investing in quality names, but this scenario is still bugging me. I did this a few times last year and hadn't thought much about it because I thought I was taking a loss each time.

Kind of panicking about what is going to show up on my taxes this year and looking for help. This was all within 30 days:

-Bought 40 shares at stock XYZ at $280/share.

-Sold 15 shares of XYZ @ $250/share.

-Repurchased 15 shares at $260/share.

-Sold 40 shares at $240/share

and did not purchase xyz again for 84+ days

Once I repurchased the 15 shares did I trigger a wash sales which I add my initial loss to for the adjusted cost basis. I'm confused about how to handle the partial shares I had left, and when I sold the entire 40 shares am I generating a gain?

this was my basic understanding of wash sales:

For example, let’s say you have 100 shares of XYZ stock that you bought for $10 a share, or $1,000 total. You sell the stock for $8 a share and then 23 days later re-buy 100 shares for $7 a share. Because you’ve repurchased the stock within the 30-day window, you have a wash sale.

So you won’t be able to claim a loss on the first lot of 100 shares, and you’ll have to add the disallowed loss onto the cost basis of your new 100 shares. In this case, your initial loss of $200 is added to your new purchase of $700 ($7 * 100 shares), meaning your new cost basis is $900. Your capital gains taxes will be figured using this adjusted cost basis.

So if I sell here at $8 I do not generate a gain, so I'm not worried about having to pay taxes. is that correct? But if I sold the stock at $12 I'd have a gain I owe taxes on $300? and if I had originally waited longer than 30 days I could have written off the $200 loss.

Sorry for the long post, any insight would be great!!

2 Answers 2


-Bought 40 shares at stock XYZ at $280/share.

You've got 40 * XYZ@280

-Sold 15 shares of XYZ @ $250/share.

You've got 25 * XYZ@280 and 15 * 30/loss

-Repurchased 15 shares at $260/share.

You've got 25 * XYZ@280 + 15 * XYZ@290 (including the wash sale loss of 30 per share)

-Sold 40 shares at $240/share and did not purchase xyz again for 84+ days

You got a loss of 1000 for the 25 * XYZ@280 and a loss of 750 for the 15 * XYZ@290, total loss of 1750. You spent 11200 on the original purchase, 150 on the panic sale/repurchase, total 11350. You sold for 9600. Numbers match.

  • Thank you for the edit, sorry I was trying alter numbers a bit to make them more friendly. Jan 12, 2022 at 1:01
  • and thank you for the feedback Jan 12, 2022 at 1:04
  • @amateurgolfer1119 did I answer your "how to handle" question though?
    – littleadv
    Jan 12, 2022 at 2:32

The purpose of the wash sale rules is to disallow tax loss harvesting without changing your position. It makes you carry forward the loss on your current position _as if you didn't sell at all). It does not prevent the deduction, but defers it until you eventually sell your position.

Since you closed your position within the tax year (I'm assuming), the wash sale rules do not apply. In other words, all gains and losses are within the same tax year and you do not have a position in XYZ to assign an adjusted tax basis to. You can claim the full $1,750 loss.

If you had repurchased the shares in one year and closed out your position in another, then your loss would have been deferred and applied to the cost basis of the 15 shares. You'd have 25 shares @ $280 and 15 shares at $290 (the $260 you paid plus the $30 loss adjustment). When you sold for $240 you'd have a total loss of $1,750.

So you don't lose the deduction, it just gets deferred until you close your position for at least 30 days.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .