Class CorrelationComputer

java.lang.Object
com.strategyquant.tradinglib.correlation.CorrelationComputer

public class CorrelationComputer extends Object
  • Field Details

    • Log

      public static final org.slf4j.Logger Log
      The Constant Log.
    • ERROR_VALUE

      public static final int ERROR_VALUE
      The Constant ERROR_VALUE.
      See Also:
      Constant Field Values
    • range

      public TimePeriod range
      The range.
    • periodsStr

      public String[] periodsStr
      The periods.
    • values1

      public double[] values1
      The values1.
    • values2

      public double[] values2
      The values2.
  • Constructor Details

    • CorrelationComputer

      public CorrelationComputer()
  • Method Details

    • computeCorrelation

      public double computeCorrelation(ResultsGroup rg1, ResultsGroup rg2, int period, CorrelationType type, boolean addEmptyPeriods)
    • computeCorrelation

      public double computeCorrelation(boolean addEmptyPeriods, String symbol1, String symbol2, OrdersList orderList1, OrdersList orderList2, CorrelationPeriods periods)
      Compute correlation between two list of orders.
      Parameters:
      addEmptyPeriods - the add empty periods
      orderList1 - the order list1
      orderList2 - the order list2
      Returns:
      the double
    • calculateCorrelation

      public static double calculateCorrelation(double[] valuesA, double[] valuesB)
      Calculate correlation between two value arrays.
      Parameters:
      valuesA - array of values a
      valuesB - array of values b
      Returns:
      the double
    • calculateSimilarity

      public static double calculateSimilarity(double[] trades, double[] line)