public class TradingHoursEma extends Ema implements Serializable
A simple ema which decays with trading time and only accepts samples during trading hours. This is intended to be used when sampling is frequent.
AbstractMa.Mode, AbstractMa.Type
lastSample, lastTimestamp, mode, timeScale, type
Constructor and Description |
---|
TradingHoursEma(AbstractMa.Type type,
AbstractMa.Mode mode,
double timeScale,
TradingHours tradingHours)
Constructs a new EMA which use the given timescale.
|
TradingHoursEma(AbstractMa.Type type,
AbstractMa.Mode mode,
double timeScale,
TradingHours tradingHours,
long gapTolerance)
Constructs a new EMA which use the given timescale.
|
Modifier and Type | Method and Description |
---|---|
void |
processDouble(long timestamp,
double data) |
getCurrent, processDoubleLocal, reset, setCurrent
getLastSample, getLastTimestamp, getTimeScale, setTimeScale
public TradingHoursEma(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale, TradingHours tradingHours, long gapTolerance)
type
- type of EMAmode
- compute the ema by tick or timetimeScale
- timescale for the EMAs.public TradingHoursEma(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale, TradingHours tradingHours)
type
- type of EMAmode
- compute the ema by tick or timetimeScale
- timescale for the EMAs.public void processDouble(long timestamp, double data)
processDouble
in class AbstractMa