-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Python for Finance

To compare the performance of mutual functions or individual stocks, we need a performance measure. In finance, we know that investors should seek a trade-off between risk and returns. It might not be a good idea to say that portfolio A is better than portfolio B since the former offered us a 30% return last year while the latter offered just 8%. The obvious reason is that we should not ignore risk factors. Because of this, we often hear the phrase "risk-adjusted return". In this section, the Sharpe ratio, Treynor ratio, Sortino ratio, and Jensen's alpha will be discussed. The Sharpe ratio is a widely used performance measure and it is defined as follows:
Here, is the mean return for a portfolio or a stock,
is the mean return for a risk-free security, σ is the variance of the excess portfolio (stock) return, and VaR is the variance of the excess portfolio (stock) return. The following code is used to estimate the Sharpe ratio with a hypothetical...
Change the font size
Change margin width
Change background colour