Class EmaArray
java.lang.Object
io.deephaven.numerics.movingaverages.EmaArray
- All Implemented Interfaces:
Serializable
An array of EMAs with different timescales.
- See Also:
-
Constructor Summary
ConstructorDescriptionEmaArray
(AbstractMa.Type type, AbstractMa.Mode mode, double[] timeScales) Constructs a new array of EMAs which use the given timescales. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
double
long
Gets the last time the ema was updated.void
processDouble
(long timestamp, double data) void
reset()
int
size()
Gets the size of the ema array.
-
Constructor Details
-
EmaArray
Constructs a new array of EMAs which use the given timescales.- Parameters:
type
- type of EMAmode
- compute the ema by tick or timetimeScales
- timescales for the EMAs.
-
-
Method Details
-
processDouble
public void processDouble(long timestamp, double data) -
reset
public void reset() -
getCurrent
public double[] getCurrent() -
size
public int size()Gets the size of the ema array.- Returns:
- size of the ema array.
-
getLastTimestamp
public long getLastTimestamp()Gets the last time the ema was updated.- Returns:
- last time the ema was updated.
-
getLastSample
public double getLastSample()
-