I'm obtaining values of a portfolio by performing a matrix multiplication of asset prices and asset quantities/volumes.
[Let's say the Prices matrix is of dimension 500 (rows) X 10 (columns), so essentially 500 days of data for 100 different assets. The quantities matrix is of dimension 1 (row) X 10 (columns). So the matrix multiplication will be mmult(prices,transpose(quantities)) Making the vector of portfolio values of dimension 500 (rows) X 1 (column).]
The problem is that the Prices matrix will be continuously growing, as more and more data become available. I want to update the vector of portfolio values with a macro, so that the portfolio values vector grows if the Prices matrix have grown. I can make sure I have all price values in a matrix by making a named range using offset. BUT, how can i make the matrix multiplication when I don't know the size of the matrix?
I was thinking you might be able to use "Evaluate", but i'm not quite sure how that works, any ideas?
I've attached an example workbook. I would like to make a macro for the button (in the portfolio values sheet) that will update the portfolio values and the number of dates in the same sheet to match the number of rows in the prices sheet (you'll have to simulate the addition of values to the prices matrix yourself).
There might be a much easier solution to this problem that i haven't thought of.. Any ideas are welcome. Thank you for your help!
Bookmarks