The average price of a holding refers to the average price you have paid to enter this position. This figure is a simple mathematical calculation and does not impact your cash flows. For example, if you buy 1 share of the stock at $100 at one time and 2 shares worth of that stock at $115, then the average price for that position is $110.

Average price = total price paid/ total number of shares bought

Using the above example: Average price = $330/3= $110

Why is there a discrepancy in my average price?
When you sell an asset that has multiple intraday trades, the broker utilises Weighted Average for intraday positions and Compressed FIFO for the end-of-day positions. Since the average price differs between the intraday positions and the end-of-day positions, the average price figure can change the day after the last trade has occurred. 

-Compressed FIFO (First-In, First-Out)
The Compressed FIFO method follows similar rules to Strict FIFO, with one key difference. It compresses intraday positions using a weighted average. Let's see how it differs:

Example 1:
Day 1:
Buy 100 shares at $10 per share (Cost basis = $1,000)
Buy 50 shares at $12 per share (Cost basis = $600)
Day 2:
Buy 30 shares at $15 per share (Cost basis = $450)
Day 3:
Sell 120 shares

After the sell transaction:
Cost Basis: 2050 - 120*(100*10 + 50*12)/150 = $770
Average entry price: cost_basis/qty_left = 770/60 = $12.83
As you can see the positions in Day 1 were compressed into a total of 150 shares with an average price of (100*10 + 50*12)/150.

Example 2
Day 1:
Buy 100 shares at $10 per share (Cost basis = $1,000)
Buy 50 shares at $9 per share (Cost basis = $450)
Sell 50 shares
Buy 50 shares at $11 per share (Cost basis = $550)

At the end of Day 1:
Cost Basis: 2000 - 50*(100*10 + 50*9 + 50*11)/200 = $1,500
Average Entry Price: 1500/150 = $10

-Weighted Average
The Weighted Average method calculates the cost basis based on the weighted average price per share. Here's how it works:

On Sell: The cost basis for the sold quantity is calculated by deducting the sell quantity multiplied by the average entry price of all the opened positions that the account holds.

Example:
Using the same example from before:
Day 1:
Buy 100 shares at $10 per share (Cost basis = $1,000)
Buy 50 shares at $12 per share (Cost basis = $600)
Day 2:
Buy 30 shares at $15 per share (Cost basis = $450)
Day 3:
Sell 120 shares

After the sell the calculations based on the Weighted average method would be:
Cost Basis: 2050 - 120*(100*10 + 50*12 + 30*15)/180 = $683.33
Average Entry Price: cost_basis/qty_left = 683.33/60 = $11.39

To learn more about our broker's method of calculating average price, please visit the link here: https://docs.alpaca.markets/docs/position-average-entry-price-calculation#compressed-fifo-first-in-first-out%20 

Was this article helpful?
5 out of 8 found this helpful