7 Actions

portfolio optimization with a loopFirstly, I revised the code some so please use the new code versus the old. What I have now for vector w and v is daily minvar port weights and values. The portret variable contains dates and each date corresponds to a row number in my vectors w and v. What I would like is just the values from w and v that correspond to the last day of the year in portret from 1990-2010 i.e. 1990-12-31, 1991-12-31... 2010-12-31. One of the reasons this is so challenging for me is that each year has a different number of trading days and the last day of the trading year may be the 31st, 30th, 29th...

portfolio optimization with a loopI actually just rewrote some of this code which answered one of my questions. I replaced j with i when populating the weight and value vectors while also making the necessary changes before the loop as well. This still leaves me with the fact that these are daily weights. I would like them annually...