Class TradingHoursEma
java.lang.Object
com.illumon.numerics.movingaverages.AbstractMa
com.illumon.numerics.movingaverages.Ema
com.illumon.numerics.movingaverages.TradingHoursEma
- All Implemented Interfaces:
Serializable
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.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.numerics.movingaverages.AbstractMa
AbstractMa.Mode, AbstractMa.Type
-
Field Summary
Fields inherited from class com.illumon.numerics.movingaverages.AbstractMa
lastSample, lastTimestamp, mode, timeScale, type
-
Constructor Summary
Constructors Constructor 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. -
Method Summary
Modifier and Type Method Description void
processDouble(long timestamp, double data)
Methods inherited from class com.illumon.numerics.movingaverages.Ema
getCurrent, processDoubleLocal, reset, setCurrent
Methods inherited from class com.illumon.numerics.movingaverages.AbstractMa
getLastSample, getLastTimestamp, getTimeScale, setTimeScale
-
Constructor Details
-
TradingHoursEma
public TradingHoursEma(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale, TradingHours tradingHours, long gapTolerance)Constructs a new EMA which use the given timescale.- Parameters:
type
- type of EMAmode
- compute the ema by tick or timetimeScale
- timescale for the EMAs.
-
TradingHoursEma
public TradingHoursEma(AbstractMa.Type type, AbstractMa.Mode mode, double timeScale, TradingHours tradingHours)Constructs a new EMA which use the given timescale.- Parameters:
type
- type of EMAmode
- compute the ema by tick or timetimeScale
- timescale for the EMAs.
-
-
Method Details
-
processDouble
public void processDouble(long timestamp, double data)- Overrides:
processDouble
in classAbstractMa
-