The average price is simply total cost / total shares you own for that particular stock. However, it can be a little confusing if you buy then sell some then buy more. Let me give a short example to illustrate.
- You buy 1000 share of stock A for total SGD1000 including transaction costs. Here, average price will simply be SGD1.
- Then you sell the 900 shares of stock A for some amount. The amount is not important since we are talking about average price. Average price here will still be SGD1 and so the total cost for that 100 shares will be SGD100.
- Finally, you buy 100 shares of stock A for SGD200 including transaction costs. Now, total cost is SGD300 for 200 shares. Hence, average price will be SGD1.5