public class EmaArray extends Object implements Serializable
An array of EMAs with different timescales.
Constructor and Description |
---|
EmaArray(AbstractMa.Type type,
AbstractMa.Mode mode,
double[] timeScales)
Constructs a new array of EMAs which use the given timescales.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getCurrent() |
double |
getLastSample() |
long |
getLastTimestamp()
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.
|
public EmaArray(AbstractMa.Type type, AbstractMa.Mode mode, double[] timeScales)
type
- type of EMAmode
- compute the ema by tick or timetimeScales
- timescales for the EMAs.public void processDouble(long timestamp, double data)
public void reset()
public double[] getCurrent()
public int size()
public long getLastTimestamp()
public double getLastSample()