My understanding of Federal tax law is that if you make several purchases of a stock and then sell part of your shares, your profit (or loss) is computed assuming the shares you sold were the first ones that you bought. I think most brokerages provide statements that makes such profit straightforward to compute. But suppose you buy and sell the same stock in two different brokerage accounts (e.g. a retail broker and an online broker). Is the profit from selling shares in one account computed as if the shares were the first purchased in that account? - or must you consider purchases made in both accounts?