This code plots efficient frontier and calculates the optimal portfolio based on Mean-variance, mean-semi variance and mean-Value at Risk measures. Only 2 asset can be used with this code. The code loads data from excel file that contains one column for each asset returns (no date). VaR calculated using historical simulation method.
Hi,what can changing the weights and and the corp variable to incoperate more assets allow it to be used for several assets?
There is a bug when I ran the code as is...
Line: w(:,1)=0:.0001:1; and next line.
I have added the comments to the updated code. Also the code is currently for 2 assets but it is very easy to modify for more assets if you know MATLAB. If needed I can modify . Let me know
Added comments to the code
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.