Class SymbolAnalysisStatisticsService

java.lang.Object
com.bluebell.greenhouse.radicle.services.symbol.analysis.SymbolAnalysisStatisticsService

@Service @Transactional(readOnly=true) public class SymbolAnalysisStatisticsService extends Object
Computes overview statistics for symbol analysis.
Version:
2.0.4
Author:
Stephen Prizio
  • Constructor Details

    • SymbolAnalysisStatisticsService

      public SymbolAnalysisStatisticsService()
  • Method Details

    • buildOverview

      public SymbolAnalysisOverview buildOverview(List<MarketPrice> marketPrices, MarketTimeInterval timeInterval, ExpansionState priceExpansion, ExpansionState volumeExpansion)
      Builds an overview payload for the given market prices.
      Parameters:
      marketPrices - List of MarketPrice
      timeInterval - MarketTimeInterval
      priceExpansion - price expansion state
      volumeExpansion - volume expansion state
      Returns:
      SymbolAnalysisOverview
    • extractSimpleReturns

      public List<Double> extractSimpleReturns(List<MarketPrice> marketPrices)
      Extracts simple percentage returns from the given market prices.
      Parameters:
      marketPrices - List of MarketPrice
      Returns:
      List of returns in percentage terms
    • extractLogReturns

      public List<Double> extractLogReturns(List<MarketPrice> marketPrices)
      Extracts log returns from the given market prices.
      Parameters:
      marketPrices - List of MarketPrice
      Returns:
      List of log returns
    • resolveBarsPerYear

      public int resolveBarsPerYear(MarketTimeInterval timeInterval)
      Returns the average number of bars per year for the given interval.
      Parameters:
      timeInterval - MarketTimeInterval
      Returns:
      annualization factor
    • mean

      public double mean(List<Double> values)
      Computes the arithmetic mean.
      Parameters:
      values - values
      Returns:
      mean
    • meanAbsolute

      public double meanAbsolute(List<Double> values)
      Computes the mean absolute value.
      Parameters:
      values - values
      Returns:
      absolute mean
    • median

      public double median(List<Double> values)
      Computes the median.
      Parameters:
      values - values
      Returns:
      median
    • standardDeviation

      public double standardDeviation(List<Double> values)
      Computes the population standard deviation.
      Parameters:
      values - values
      Returns:
      standard deviation