I have a collection of client transactions representing the trades of a single portfolio across multiple securities. What I'd like to do is the calculate the accurate ROI of each security and of the whole portfolio (total and by year).
Sounds simple but it's not in a number of dimensions:
- I only have all the transactions between date a and date b, so there may be some starting position that I can only guess based on the transaction I have.
- As there may be splits, reverse splits, and other changes of capital I can't just add the volumes from transactions because they may not be on the same scale (e.g. one is before and one is after a split).
- To avoid caring about dividends and bonuses I'd like to use the adjusted closing prices but that creates a couple of problems - because the adjusted closing already accounts for capital changes so I can't just multiply adjusted volume by adjusted price.
Any ideas? is there a simple standard way of solving this?