January 2020
Beginner to intermediate
432 pages
11h 24m
English
Having simulated 100,000 random portfolios, we can also investigate which one has the highest Sharpe ratio (maximum expected return per unit of risk, also known as the Tangency Portfolio) or minimum volatility. To locate these portfolios among the simulated ones, we use np.argmin and np.argmax, which return the index of a minimum/maximum value in the array.
The code is as follows:
max_sharpe_ind = np.argmax(portf_results_df.sharpe_ratio)max_sharpe_portf = portf_results_df.loc[max_sharpe_ind]min_vol_ind = np.argmin(portf_results_df.volatility)min_vol_portf = portf_results_df.loc[min_vol_ind]
We can also investigate the constituents of these portfolios:
print('Maximum Sharpe ratio portfolio ----')print('Performance')for index, ...Read now
Unlock full access