def get_stats()

in python-batch/fsi_montecarlo/OLD/pubsub_bq.tpl.py [0:0]


  def get_stats(self):
    close = self.data
    self.first = close[0]
    self.last = close[-1]
    self.trading_days = len(close)
    self.cagr = (self.last / self.first) ** (365.0/self.calendar_days) -1.0
    self.volatility =  self.data.pct_change().std()
    return(self.first, self.last, self.trading_days, self.cagr, self.volatility)