Class BloomSignalService

java.lang.Object
com.bluebell.greenhouse.anther.services.analysis.BloomSignalService

@Service public class BloomSignalService extends Object
Shared Bloom signal engine used by both trading-strategy execution and symbol-analysis adapters.
Version:
2.0.4
Author:
Stephen Prizio
  • Constructor Details

    • BloomSignalService

      public BloomSignalService()
  • Method Details

    • buildEmaLookup

      public Map<LocalDateTime, Double> buildEmaLookup(List<MarketPrice> marketPrices, int period)
      Builds an EMA lookup for the given market prices and period.
      Parameters:
      marketPrices - List of MarketPrice
      period - EMA period
      Returns:
      lookup keyed by market-price date
    • getRequiredBarCount

      public int getRequiredBarCount(BloomTradingStrategyParameters parameters)
      Returns the required number of bars needed to safely evaluate Bloom.
      Parameters:
      parameters - BloomTradingStrategyParameters
      Returns:
      required bar count
    • getRequiredBarCount

      public int getRequiredBarCount(int fastEmaPeriod, int slowEmaPeriodOne, int slowEmaPeriodTwo)
      Returns the required number of bars needed to safely evaluate Bloom.
      Parameters:
      fastEmaPeriod - fast EMA period
      slowEmaPeriodOne - first slow EMA period
      slowEmaPeriodTwo - second slow EMA period
      Returns:
      required bar count
    • determineSignal

      public AntherSignal determineSignal(int currentBarIndex, List<MarketPrice> marketPrices, Map<LocalDateTime, Double> fastEmaValues, Map<LocalDateTime, Double> slowOneEmaValues, Map<LocalDateTime, Double> slowTwoEmaValues)
      Determines the Bloom signal for the given execution-bar index.
      Parameters:
      currentBarIndex - current execution-bar index
      marketPrices - List of MarketPrice
      fastEmaValues - fast EMA lookup
      slowOneEmaValues - first slow EMA lookup
      slowTwoEmaValues - second slow EMA lookup
      Returns:
      AntherSignal