Investing in stocks comes with a certain amount of risk. It may help you to know what your gains and losses are so that you can gauge the winners and losers in your portfolio. Calculating stock profit also helps with tax planning and portfolio rebalancing.