This question is closed. Reopen it to edit or answer.

returns on a portfolio

1 view (last 30 days)
Mate 2u
Mate 2u on 20 Jul 2012
Hi all, I have a matrix called ETNWED which is a set of historical prices of 34 Shares. The size is 294x34 where there is 295 weeks and 34 shares, and the entries are their prices.
Ok additionally I have a matrix called Returns, which is the MONEY MADE at each time and for each share. This is also size of 294x34. So lets say for instance in Returns(10,2) =2. This mean that in week 10 our share number 2 made 2 dollars.
Now I want to produce a final return after 294 weeks. I am quite confused on how to do this.
My initial method was:
  • Every week (ie, for i=1:294) do the sum of money made (ie sum of rows of returns) / sum of money invested (so this is the sum of the rows of ETNWED (but only the sum of the values which generated a return)).
Then I just added 1 and then did Prod of all of this to get final return.
If somebody can give me some advice I would really appreciate it.
Rick Rosson
Rick Rosson on 20 Jul 2012
How many shares of each stock do you have in your portfolio? If you have one share of each stock, then that is fine. Otherwise, you will need a 34 element array to represent the number of shares for each issue.
Also, does the matrix called Returns represent the change in the stock price alone, or does it also include any cash dividends that may have been paid?
Likewise, have you accounted for any stock splits or stock dividends that may have occurred during the time frame of your data set? If so, how are they represented?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!