def Update(self, ts, sample):
    if self._time == -1:
      self._time = ts
      self.value = float(sample)
    else:
      delta = ts - self._time
      self._time = ts
      window = 0 if self._window == 0 else math.exp(-float(delta) / self._window)
      self.value = (sample * (1-window)) + (self.value * window)
    return self.value
Update the EMA with a new sample
dataset/ETHPy150Open steveniemitz/scales/scales/varz.py/Ema.Update