フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to limit the stocks in a portfolio from a larger population?

1 回表示 (過去 30 日間)
Gideon Maasz
Gideon Maasz 2017 年 11 月 11 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I currently have a problem using the functions in MATLAB for using investment portfolios. I have a population of 143 stocks but want to limit the amount put into my portfolio at the end of the day to 10. It is currently not bound. I do not know how to assign such a constraint to a portfolio object. Any help please? =)
  2 件のコメント
Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2017 年 11 月 11 日
There is no generic answer to your question. Please share your code.
Gideon Maasz
Gideon Maasz 2017 年 11 月 11 日
MATLAB code
%Determine returns, covar, risk
R_Bar = mean(StockDataArray);
sigma = std(StockDataArray,1);
Correlation = corrcoef(StockDataArray);
Covariance = corr2cov(sigma,Correlation);
%Draw efficient frontier portopt(R_Bar,Covariance,100)
%Set portfolio data %Calculate necessary portfolio data p = Portfolio; p = setAssetList(p, AssetList); p = Portfolio('assetmean', R_Bar, 'assetcovar', Covariance, 'RiskfreeRate', 0.08/252, ... 'NumAssets',TotalStocks); p=estimateAssetMoments(p,StockDataArray); p = setDefaultConstraints(p); p = setAssetList(p);
%Display Weights Weights = estimateMaxSharpeRatio(p);
%Daily Risk and Returns [risk1,ret1] = estimatePortMoments(p,Weights);

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by