MATLAB: Can I make global leverage constraints on a portfolio using a Portfolio object

Financial Toolbox

I would like to set a leverage constraints on the entire portfolio (max sum of positive weights, max sum of negative weights). However, using the MATLAB function "setBounds" functionally distributes the desired leverage boundary value to every asset, allowing the portfolio leverage to achieve upper bounds equivalent to 'desired leverage' * 'n assets'.
More generally, I would also like to be able to set group level upper and lower bounds such that the max sum of positive weights can be bounded by some value U, and the max sum of negative weights is >= L.
How can I do this?

Best Answer

If the initial portfolio is zero (i.e. InitPort = 0 or []), the global leverage constraints can be set as follows.
Instead of using "setBounds", use "setOneWayTurnover". The syntax for this is:
obj = setOneWayTurnover(obj,BuyTurnover,SellTurnover,InitPort,NumAssets);
The global constraint can be implemented by setting the "BuyTurnover" as the max of sum of absolute values of positive weights and "SellTurnover" as max of sum of absolute values of negative weights. Again, the "InitPort" has to be zero or empty in this case. This is because the current version of the portfolio class only allows construction of the leveraged portfolio when the initial portfolio weights are zero.
Please refer to the following documentation on "setOneWayTurnover".