class_docstr: A :class:`pyalgotrade.stratanalyzer.StrategyAnalyzer` that calculates
  Sharpe ratio for the whole portfolio.
  
  :param useDailyReturns: True if daily returns should be used instead of the returns for each bar.
  :type useDailyReturns: boolean.
code: def __onReturns(self, dateTime, returnsAnalyzerBase):
      netReturn = returnsAnalyzerBase.getNetReturn()
      if self.__useDailyReturns:
          # Calculate daily returns.
          if dateTime.date() == self.__currentDate:
              self.__returns[-1] = (1 + self.__returns[-1]) * (
                  1 + netReturn
              ) - 1
          else:
              self.__currentDate = dateTime.date()
              self.__returns.append(netReturn)
      else:
          self.__returns.append(netReturn)
          if self.__firstDateTime is None:
              self.__firstDateTime = dateTime
          self.__lastDateTime = dateTime
  
file_path: pyalgotrade/pyalgotrade/stratanalyzer/sharpe.py
imports: from pyalgotrade import stratanalyzer
  from pyalgotrade.stratanalyzer import returns
  from pyalgotrade.utils import stats
  import math
label_desc: Use image node_id 4 for calling the SharpeRatio obj's underlying member method code with example usage: obj.__onReturns(dateTime, returnsAnalyzerBase) without return types