java.lang.Object
io.deephaven.numerics.movingaverages.AbstractMa
io.deephaven.numerics.movingaverages.Ema
All Implemented Interfaces:
Serializable

public class Ema extends AbstractMa implements Serializable
An EMA.
See Also:
  • Constructor Details

    • Ema

      public Ema(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale)
      Constructs a new EMA which use the given timescale.
      Parameters:
      type - type of EMA
      mode - compute the ema by tick or time
      timeScale - timescale for the EMAs.
  • Method Details

    • processDoubleLocal

      protected void processDoubleLocal(long timestamp, double data)
      Specified by:
      processDoubleLocal in class AbstractMa
    • getCurrent

      public double getCurrent()
      Gets the current value of the ema.
      Specified by:
      getCurrent in class AbstractMa
      Returns:
      current value of the ema.
    • setCurrent

      public void setCurrent(double value)
      Sets the current value of the ema state.
      Specified by:
      setCurrent in class AbstractMa
      Parameters:
      value - new value of the ema state.
    • reset

      public void reset()
      Specified by:
      reset in class AbstractMa