Class EmaArray
java.lang.Object
com.illumon.numerics.movingaverages.EmaArray
- All Implemented Interfaces:
Serializable
An array of EMAs with different timescales.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmaArray(AbstractMa.Type type, AbstractMa.Mode mode, double[] timeScales) Constructs a new array of EMAs which use the given timescales. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]doublelongGets the last time the ema was updated.voidprocessDouble(long timestamp, double data) voidreset()intsize()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()
-