%% Set Up Transaction Costs for a PortfolioCVaR Object
% Given a CVaR portfolio object p with an initial portfolio already set, use the setCosts function to set up transaction costs.

bc = [ 0.00125; 0.00125; 0.00125; 0.00125; 0.00125 ];
sc = [ 0.00125; 0.007; 0.00125; 0.00125; 0.0024 ];
x0 = [ 0.4; 0.2; 0.2; 0.1; 0.1 ];

p = PortfolioCVaR('InitPort', x0);
p = setCosts(p, bc, sc);
        
disp(p.NumAssets);
disp(p.BuyCost);
disp(p.SellCost);
disp(p.InitPort);

% Copyright 2015 The MathWorks, Inc.