Class BloomSignalService
java.lang.Object
com.bluebell.greenhouse.anther.services.analysis.BloomSignalService
Shared Bloom signal engine used by both trading-strategy execution and symbol-analysis adapters.
- Version:
- 2.0.4
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildEmaLookup(List<MarketPrice> marketPrices, int period) Builds an EMA lookup for the given market prices and period.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.intgetRequiredBarCount(int fastEmaPeriod, int slowEmaPeriodOne, int slowEmaPeriodTwo) Returns the required number of bars needed to safely evaluate Bloom.intgetRequiredBarCount(BloomTradingStrategyParameters parameters) Returns the required number of bars needed to safely evaluate Bloom.
-
Constructor Details
-
BloomSignalService
public BloomSignalService()
-
-
Method Details
-
buildEmaLookup
Builds an EMA lookup for the given market prices and period.- Parameters:
marketPrices-ListofMarketPriceperiod- EMA period- Returns:
- lookup keyed by market-price date
-
getRequiredBarCount
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 periodslowEmaPeriodOne- first slow EMA periodslowEmaPeriodTwo- 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 indexmarketPrices-ListofMarketPricefastEmaValues- fast EMA lookupslowOneEmaValues- first slow EMA lookupslowTwoEmaValues- second slow EMA lookup- Returns:
AntherSignal
-