# How to calculate portfolio stock average?

I want to find out how to calculate stock average price. I understand how to calculate average when you are buying shares, but I'm not exactly sure how to calculate the average when you sell shares.

Here is an example:

• On day 1 I'm buying 1 share of ABCD for \$10. My average is \$10 per share.
• On day 2 I'm buying 3 shares of ABCD for \$12 each. My average is \$11.50 per share ( `(10 + 3*12) / 4` )
• On day 3 I'm selling shares of 2 ABCD for \$15 each. So, what is my average after this transactions?

Before selling, I've got 4 shares of ABCD:

1. ABCD bought for \$10
2. ABCD bought for \$12
3. ABCD bought for \$12
4. ABCD bought for \$12

I can imagine several ways to calculate average:

• Selling transactions sells the first share that I've bought for \$10 and the second one that I've bought for \$12. So I'm left with 2 \$12 shares and my average is \$12.
• Selling transactions sells the last 2 shares that I've bought. So I'm left with one \$10 and one \$12 share and my average is \$11.
• Selling transactions does not affect the average. So after the sell I still have \$11.50 average.

Or maybe there is some other algorithm.

So the question is: what is the industry standard for calculating the portfolio average?

• I have no clue what industry standards are. I use FIFO and any positions closed are in the books and that risk is gone. Same symbol? Different symbol? Gone! What remains open and at risk is averaged for current cost per share. Mar 25, 2018 at 16:40
• Bob, would you like to turn that into an answer? Another sentence or two and that would be that. Mar 25, 2018 at 16:49
• At least for US the industry standard is to track each lot separately because you have the choice of designating specific lot(s) to sell and the broker must (since 2012ish depending on security type) be able to report to IRS basis for whichever lot(s) you designate(d) or be in violation of law. The default designation is FIFO, as @Joe said. Mar 26, 2018 at 0:34
• You mean Bob. I actually did not say anything this time Mar 26, 2018 at 0:36