How weighted-average cost basis works
Avg Cost = Σ(Shares × Price) ÷ Σ(Shares)
Each lot contributes proportionally to your overall cost basis based on its share count. Buying more shares at a lower price pulls the average down; buying more at a higher price pushes it up. Brokers in the US default to this method for mutual funds and offer it as an option for stocks (alongside FIFO, LIFO, and Specific ID).
The trap of averaging down
Averaging down lowers your break-even price — and that feels good. But it does not change whether the original thesis was correct. If a stock dropped 40% because the business deteriorated, throwing more money at it just concentrates more capital in a deteriorating business. The math is right; the psychology is dangerous.
A useful sanity check: would you initiate a new position at the current price, with no prior shares? If yes, averaging down is defensible. If no, you are throwing good money after bad.
Tax-lot accounting matters
For US taxable accounts, your broker tracks each lot separately for tax purposes. When you sell, the lot selected (FIFO by default, but you can specify) determines your gain/loss. This calculator shows the weighted average — useful for thinking about break-even — but your actual tax basis on a sale depends on which specific lots you sell.