We are going to search for the optimal portfolio, i.e. one that has the highest risk-adjusted return. To do so, we will maximize the portfolio’s Sharpe ratio. The Sharpe Ratio is a financial metric that helps investors determine the return of an investment compared to its risk. The higher the Sharpe Ratio of a portfolio, the better it is in terms of risk-adjusted return.
http://tech.harbourfronts.com/modern-portfolio-theory-searching-for-the-optimal-portfolio-portfolio-management-in-python/