When selling your stocks, the difference between the selling price and the stock basis determines the amount of capital gain/loss.
Check the link below for information on how to get your stock basis: