Weekly maintenance every saturday 03:00 - 06:00 UTC
Register on website and
click this link
to download the data example for portfolio optimization.
Unzip the downloaded zip archive. There will be three folders - all_stock_data folder which contains
the example files with all the stock prices, etc... to optimize portfolio not using the website's stock data,
the universe_data folder which contains the file with list of tickers - tickers.csv
to optimize portfolio using the website's stock data, and two files - viewdict.csv with view data
and confidences.csv with confidence data for the Black - Litterman model, and the
portfolio_setting folder which contains the preconfigured portfolio settings files.
Now go to the Optimize portfolio page (the link is located at the left sidebar).
Go to the Optimize page. Now you can either click on the button "Read settings..." to load the portfolio settings from a preconfigured settings file (these are in the folder portfolio_settings/mean_variance_optimization of the unzipped archive), then set the desired number of years, number of months for the time horizon, and choose the tickers.csv file from the uploaded earlier universe_data folder, then click the Optimize button.
Alternatively you can follow the instructions below to set the portfolio settings manually.
- Ensure that Upload the stock data from my computer (use intrinsic stock data source if unchecked) checkbox is unchecked.
- Ensure that Upload the stock data from my computer (use intrinsic stock data source if unchecked) checkbox is unchecked.
- Ensure that Use close prices for statistics calculation (use the adjusted close prices if unchecked) checkbox is checked. You can leave this checkbox checked if you like, but in this case you will use the adjusted close prices instead of close prices.
- Click button Choose File right under caption Choose stock universe file, choose the tickers.csv file from the uploaded earlier universe_data folder.
- Set the desired number of years, number of months for the time horizon.
- Ensure that value of Choose type of calculation of mean returns and covariance matrix control value set to Independent.
- Ensure that value of Choose type of mean historical return calculation control set to Mean historical return.
- Ensure that value of Choose type of covariance matrix calculation control set to Sample covariance.
- Ensure that value of Choose optimization method control set to Mean - variance optimization.
- Ensure that value of Choose optimization type for Mean - variance optimization control set to Minimize volatility.
- Click the button Optimize at the bottom of the page.
- After you see the message Now you can take a look at your optimization result at the log window, check if there were warnings.
- Click the Optimization result... button to view you optimization results. Note that you can sort or search your optimization result tables. To search table enter your search sequence in the Search field, to sort the table by column values mouse-click the corresponding column header.
-
To save your portflio settings to a file, click the button Save settings.
To load your portfolio settings from a saved file, click the button Read settings... and choose a portfolio settings file saved earlier.
- To export the portfolio optimization results to XLSX file, click the button Export report to XLSX .
- If you see the error message Error: 0 - after you clicked button Optimize, just reload the page.
- adj_clos.csv is a csv file with historical prices for stocks.
- close.csv is a csv file with close prices for stocks for previous day.
- index_prices.csv is a csv file with index prices for some index used for Black - Litterman
model calculation.
- viewdict.csv is a csv file with expected return views data for Black - Litterman model calculations.
- confidences.csv is a csv file with view confidences data for Idzorek model calculations.
- mcaps.csv is a csv file with market caps data for Black - Litterman model calculations.
- sector.csv is a csv file with sector data for stocks.
- data_info.csv is a json file with version data and index symbol.
- tickers.csv is a csv file which contains a list of tickers to use in the portfolio optimization.
- viewdict.csv and confidences.csv files have the same meaning and format as the ones for
all_stock_data folder.
There are the portfolio settings examples for the different types of mean-variance optimization;
All of the setting examples can be loaded by clicking on the button Read settings... on the optimize
webpage and choosing the corresponding file.
maximize_quadratic_utility.json - this is a settings file for maximizing quadratic utility for a given value of the risk aversion.
maximize_return.json - this is a settings file for maximizing portfolio return
for a given value of the target volatility.
maximize_sharpe.json - this is a settings file for maximizing Sharpe ratio.
minimize_risk.json - this is a settings file for minimizing portfolio volatility for
a given value of the target return.
minimize_risk.json - this is a settings file for minimizing portfolio volatility for
a given value of the target return.
minimize_volatility.json - this is a settings file for minimizing the portfolio volatility.
See also:
Optimizing Sharpe ratio article.