Calculation of Total Profit or Loss