How is the average purchase price calculated?
The average stock purchase price is equal to the total number of shares purchased divided by the total cost, not including commissions (commissions are tracked separately). Note, however, that if you sell all the shares of a particular stock at some point and then later purchase some more, the average purchase price will only include the most recently-purchased stock. Any gains or losses realized from the earlier time period will be included in the “Gain (loss), earlier holdings” line item in the Holdings view of the portfolio. Similarly, short sales are handled separately. When a stock splits, the average purchase price is recalculated to correspond to the updated number of shares.