Class Ema
java.lang.Object
io.deephaven.numerics.movingaverages.AbstractMa
io.deephaven.numerics.movingaverages.Ema
- All Implemented Interfaces:
Serializable
An EMA.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.numerics.movingaverages.AbstractMa
AbstractMa.Mode, AbstractMa.Type
-
Field Summary
Fields inherited from class io.deephaven.numerics.movingaverages.AbstractMa
lastSample, lastTimestamp, mode, timeScale, type
-
Constructor Summary
ConstructorDescriptionEma
(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale) Constructs a new EMA which use the given timescale. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Gets the current value of the ema.protected void
processDoubleLocal
(long timestamp, double data) void
reset()
void
setCurrent
(double value) Sets the current value of the ema state.Methods inherited from class io.deephaven.numerics.movingaverages.AbstractMa
getLastSample, getLastTimestamp, getTimeScale, processDouble, setTimeScale
-
Constructor Details
-
Ema
Constructs a new EMA which use the given timescale.- Parameters:
type
- type of EMAmode
- compute the ema by tick or timetimeScale
- timescale for the EMAs.
-
-
Method Details
-
processDoubleLocal
protected void processDoubleLocal(long timestamp, double data) - Specified by:
processDoubleLocal
in classAbstractMa
-
getCurrent
public double getCurrent()Gets the current value of the ema.- Specified by:
getCurrent
in classAbstractMa
- Returns:
- current value of the ema.
-
setCurrent
public void setCurrent(double value) Sets the current value of the ema state.- Specified by:
setCurrent
in classAbstractMa
- Parameters:
value
- new value of the ema state.
-
reset
public void reset()- Specified by:
reset
in classAbstractMa
-