This question already has an answer here:
I'm programming a web app to track my hedge fund performance. I'd like to find my overall ROI for all time.
If I had a beginning balance and my current balance then finding the ROI is easy. For instance ((current balance / beginning balance) * 100) to get the percentage.
Where I am having difficulty is in the fact that each week there are debits/credits to the account.
So how can I accurately figure a lifetime ROI when each week I'm adding/removing funds?
Here is an example weekly report.
9/9/2013-9/13/2013 : beginning balance = 25000 : Profit/Loss in % = 16.45 : Gross Profit/Loss = 4,112.72 : Debit/Credit = -2000 : New Balance 27,114
Imagine the next 9 weeks look similar with fluctuating profit/loss percentages (weekly roi's)
Can any of you geniuses provide me with a formula for discovering how to ascertain exactly how well the hedge fund manager has been doing up to present day regardless of how many weeks I have been involved? I'm assuming some type of weekly compounding.
EDIT: So I found a formula that I think is useful and plugged in 4 weeks worth of data
25000((1+i)^4) - 4000((1+i)^3) - 300((1+i)^2) - 1500((1+i)) = 32318.63
How might I solve for 'i'?