'Returns the Sharpe ratio for the strategy execution. If the volatility is 0, 0 is returned.
:param riskFreeRate: The risk free rate per annum.
:type riskFreeRate: int/float.
:param annualized: True if the sharpe ratio should be annualized.
:type annualized: boolean.'

def getSharpeRatio(self, riskFreeRate, annualized=True):

    if (not isinstance(annualized, bool)):
        raise Exception('tradingPeriods    parameter    is    not    supported    anymore.')
    if self.__useDailyReturns:
        ret = sharpe_ratio(self.__returns, riskFreeRate, 252, annualized)
    else:
        ret = sharpe_ratio_2(self.__returns, riskFreeRate, self.__firstDateTime, self.__lastDateTime, annualized)
    return ret
