Class 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:
  • 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 EMA
      mode - compute the ema by tick or time
      timeScale - 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 EMA
      mode - compute the ema by tick or time
      timeScale - timescale for the EMAs.
  • Method Details

    • processDouble

      public void processDouble(long timestamp, double data)
      Overrides:
      processDouble in class AbstractMa