This is simply computing the amount of capital that is being injected or withdrawn from your portfolio.
Note: Buy transactions and Fees transactions are considered capital inflow.
Dividends collected and Sell transactions are considered as capital outflow.
Note that cash transactions are not included.