public class NeighborEmaArrayDifferencer extends Object implements Serializable
Computes the differences between values in an array of emas.
Constructor and Description |
---|
NeighborEmaArrayDifferencer(AbstractMa.Mode emaMode,
double[] emaTimescales,
boolean includeDifferenceWithCurrentValue)
Constructs a new calculator.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getCurrent()
Gets the current difference in the latest value and the emas.
|
double |
getLastSample() |
long |
getLastTimestamp()
Gets the last time the ema was updated.
|
void |
processDouble(long timestamp,
double data) |
void |
reset() |
public NeighborEmaArrayDifferencer(AbstractMa.Mode emaMode, double[] emaTimescales, boolean includeDifferenceWithCurrentValue)
emaMode
- type of ema calculation.emaTimescales
- timescales for the ema.includeDifferenceWithCurrentValue
- true includes the difference between the latest input value and the first ema in the output results; false does not.public void processDouble(long timestamp, double data)
public double[] getCurrent()
public void reset()
public long getLastTimestamp()
public double getLastSample()