Calculate the capital gain or loss of this transaction based on info from the provided transaction history