In Canada my understanding is that its like adding cups of water to a pot at different temperature levels. The final temperature of the entire potful is equivalent to the cost per share of the entire group.
It is not a "first in/first out.
I was aware of the 30 day rule on selling for loss and then buying back but not sure how it applies to the opposite which would be buying and thereafter selling in a short term.
Will have to do some checking. Likely a "most tax" applies.
As I have said I have never confronted this before as I do very little day trading but the coming 10 days might disuade me from that. I suspect of prime importance is keeping very good records and then let the accountant sort through it when its all said and done.
Onward and Upward.