Asking from US tax perspective,
- I have a stock that I bought for $1.
- I sell it at some point for $2.
- Within a week or two after, the same stock falls to $1.3. At this point, I buy one stock again.
Is tax calculated on the basis of $0.7 (2 - 1.3, net extra money I ended up with) or $1 (the gain from the first lot)? Does time period between these events make any difference?