Don't try to compute all your accounting incrementally, it doesn't make sense because everything is a function of the underlying price which is continuously changing. When you execute a trade, the only thing that you need to account for is your number of shares and cost basis, and transaction...