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 __init__(self, useDailyReturns=True):
      super(SharpeRatio, self).__init__()
      self.__useDailyReturns = useDailyReturns
      self.__returns = []
  
      # Only use when self.__useDailyReturns == False
      self.__firstDateTime = None
      self.__lastDateTime = None
      # Only use when self.__useDailyReturns == True
      self.__currentDate = None
  
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 1 to create a new SharpeRatio object from inherited base classes: stratanalyzer with example: obj = SharpeRatio(useDailyReturns)