I am trying to understand how the replacement stock is selected when applying the wash sale rule. This is in the USA. I have scoured the IRS publications that seem relevant and am still unenlightened.
Here is a situation (same stock throughout). This reflects a (one of many, unfortunately) situation I have, and am getting lost trying to reverse engineer the transactions.
I buy 2,000 shares on Jan 1. The way the transaction goes is that the first 1,000 are bought at $11 and the second 1,000 are bought at $9.
I buy 1,000 shares on Jan 2 at $9.
I sell 1,000 shares at $10 on Jan 3.
Which shares are the replacement shares for the wash sale on Jan 3? The 1,000 bought at $9 on Jan 1 or the 1,000 bought on Jan 2?
I am, in general, trying to understand the specific mechanics that apply when determining which stock is the replacement stock. Any pointers to relevant publications, etc, would be much appreciated.
I am familiar with Publication 550, etc. I have have many wash sales over many years and have even written a Python script to unravel my 1099B. Unfortunately, the frequency of wash sales I have incurred over the years has increased, and I keep hitting 'corner cases' which require understanding the rules in increasing levels of detail. This time, I am trying to understand the replacement share dynamics. In particular, which lots are the replacement lots. In the example above, can the replacement shares come from the same buy that triggered the wash?
In particular, it would be great to see the actual rules described somewhere. Most of what I have found are examples, which are nice if they apply unequivocally to my situation, but they don't, and even when they do, it is illustrative and not conclusive.
I am not asking if there was a wash sale, I am asking which are the replacement shares and a pointer to definitive documentation. (In particular, can the replacement shares come from the same buy order?)
To show my confusion, here is a real example. The sells reflect the individual lots reported by my brokerage (I put in one order to sell 1,000, but this was executed in two lots 100, 900):
05/30/2014 XXX buy 1,000 $88.31/sh. 06/02/2014 XXX buy 1,000 $88.01/sh. 06/02/2014 XXX sell 100 $88.27/sh. 06/02/2014 XXX sell 900 $88.27/sh.
Here the replacement shares for the sell 100 were taken from the 06/02 buy. I would have expected them to come from the remaining 900 in the 05/30 buy.