How to find average price of stock

How can investors calculate their average cost basis for stock holdings?