1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| BuyCost = 0.0020; SellCost = 0.0020; Turnover = 0.2;
q = setCosts(p, BuyCost,SellCost); q = setTurnover(q,Turnover);
[qwgt,qbuy,qsell] = estimateFrontier(q,20); [qrsk,qret] = estimatePortMoments(q,qwgt);
clf; portfolioexamples_plot('Efficient Frontier with Turnover Constraint', ... {'line', prsk, pret, {'Unconstrained'}, ':b'}, ... {'line', qrsk, qret, {sprintf('%g%% Turnover', 100*Turnover)}}, ... {'scatter', [mrsk, crsk, ersk], [mret, cret, eret], {'Market', 'Cash', 'Equal'}}, ... {'scatter', sqrt(diag(p.AssetCovar)), p.AssetMean, p.AssetList, '.r'}); displaySumOfTransactions(Turnover, qbuy, qsell)
|