I want to find the optimal weights in an multi-asset portfolio by minimizing the VaR. This is the code that gives a minimum risk for a target return.
p = PortfolioCVaR('ProbabilityLevel', .99, 'AssetNames', names);
p = p.setScenarios(R); % R= asset returns
p = p.setDefaultConstraints();
wts = p.estimateFrontier(20);
portRisk = p.estimatePortRisk(wts);
portRet = p.estimatePortReturn(wts);
clf
visualizeFrontier(p, portRisk, portRet);
%% Compute portfolio with given level of return
tic;
wt = p.estimateFrontierByReturn(.05/100);
toc;
pRisk = p.estimatePortRisk(wt);
pRet = p.estimatePortReturn(wt);
The sum of weights = 1 .. My question is how to add a constraint such that no asset can have a weight of greater than 60%. Thank you for any help you could provide
Use the object's
setBounds
property,See
for more info.