public class Ema extends AbstractMa implements Serializable
An EMA.
AbstractMa.Mode, AbstractMa.TypelastSample, lastTimestamp, mode, timeScale, type| Constructor and Description |
|---|
Ema(AbstractMa.Type type,
AbstractMa.Mode mode,
double timeScale)
Constructs a new EMA which use the given timescale.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getCurrent()
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.
|
getLastSample, getLastTimestamp, getTimeScale, processDouble, setTimeScalepublic Ema(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale)
type - type of EMAmode - compute the ema by tick or timetimeScale - timescale for the EMAs.protected void processDoubleLocal(long timestamp,
double data)
processDoubleLocal in class AbstractMapublic double getCurrent()
getCurrent in class AbstractMapublic void setCurrent(double value)
setCurrent in class AbstractMavalue - new value of the ema state.public void reset()
reset in class AbstractMa