I have some shares where I have big losses and others with big gains. I want to get rid of the shares with big losses completely, but want to use the tax deduction. Can I also sell the shares with big gains and rebuy them? Is that part of the wash sale rule or is that excluded?
Say you have $6K in losses, and $8K in gains. It's clever to use gains to offset losses and vice versa, but consider.
You take $3K/yr loss. It offsets 33% marginal rate income. For 2 years.
You take $8K in gains in other years (not when you take any loss) and you pay long term cap gain at 15%.
This should answer your question.