Say I buy stock X on Monday, sell it on Tuesday for a $200 profit, buy it back on Wednesday, then sell it on Thursday for a $100 loss. The next week, I buy it again on Monday and sell it for another $100 loss on Tuesday. For the rest of the year I do not buy stock X again.
In total I had a $200 gain and 2x $100 losses. If I understand wash sale rules correctly, when I bought the stock on Monday of the second week, a wash sale occurred and my cost basis should be adjusted to include to previous loss. What happens after I do my final sell of the stock? Do the total gains & losses offset each other and on my capital gains I see a net gain of $0 for the year?